vue/no-watch-after-await
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-watch-after-await": "error",
},
},
];<script>
import { watch } from 'vue'
export default {
async setup() {
await doSomething()
watch(foo, () => { /* ... */ }) // error
}
}
</script><script>
import { watch } from 'vue'
export default {
async setup() {
watch(foo, () => { /* ... */ }) // ok
await doSomething()
}
}
</script>Examples from the Oxlint documentation.
vue/no-watch-after-await
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-watch-after-await": "error",
},
},
];vue/no-watch-after-await
vue plugin · correctness
{
"plugins": [
"vue"
],
"rules": {
"vue/no-watch-after-await": "error"
}
}nursery/noVueWatchAfterAwait
nursery · since 2.6.3
{
"linter": {
"rules": {
"nursery": {
"noVueWatchAfterAwait": "error"
}
}
}
}Disallow side effects in computed properties
Enforce import from 'vue' instead of import from '@vue/*'
Require prop type to be a constructor
Enforce render function to always return value