Closed
Description
Checklist
- I have tried restarting my IDE and the issue persists.
- I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version: 8.15.0
- eslint-plugin-vue version: 9.0.0
- Node version: 16.14.2
- Operating System: macOS Monterey
Please show your full configuration:
module.exports = {
env: {
node: true,
},
extends: ['plugin:vue/vue3-recommended', 'eslint:recommended'],
parserOptions: {
ecmaVersion: 'latest',
},
root: true,
};
What did you do?
<script setup>
import { onMounted, ref, watch } from 'vue';
await new Promise((r) => {
setTimeout(r, 1000);
});
onMounted(() => {
console.log('mounted child');
});
let foo = ref('');
watch(foo, () => {
console.log('foo', foo);
});
function bar() {
console.log('bar');
}
bar();
</script>
What did you expect to happen?
No violations should be reported.
What actually happened?
/home/projects/vitejs-vite-vaxgjy/src/ChildComponent.vue
6:1 error `onMounted` is forbidden after an `await` expression vue/no-expose-after-await
12:1 error `watch` is forbidden after an `await` expression vue/no-expose-after-await
19:1 error `bar` is forbidden after an `await` expression vue/no-expose-after-await
✖ 3 problems (3 errors, 0 warnings)
Repository to reproduce this issue
https://stackblitz.com/edit/vitejs-vite-vaxgjy?file=src/ChildComponent.vue
Steps to reproduce:
- Open a new terminal tab.
- Run
npm run lint
.
Metadata
Metadata
Assignees
Labels
No labels