Closed
Description
What rule do you want to change?
no-lifecycle-after-await
Does this change cause the rule to produce more or fewer warnings?
More warnings
How will the change be implemented? (New option, new default behavior, etc.)?
It will change the behavior of the existing I rule. I think no options should be necessary.
Please provide some example code that this change will affect:
<script setup>
import { onMounted } from 'vue'
/* ✓ GOOD */
onMounted(() => { /* ... */ })
await doSomething()
/* ✗ BAD */
onMounted(() => { /* ... */ })
</script>
What does the rule currently do for this code?
There are no errors.
What will the rule do after it's changed?
The second onMounted
will trigger an error
Additional context
This rule currently works only when using a setup function.
<script>
import { onMounted } from 'vue'
export default {
async setup() {
/* ✓ GOOD */
onMounted(() => { /* ... */ })
await doSomething()
/* ✗ BAD */
onMounted(() => { /* ... */ })
}
}
</script>
I think the fix would be similar to the one done for no-expose-after-wait
. #1885
Metadata
Metadata
Assignees
Labels
No labels