-
-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow top-level await before defineExpose #1872
Comments
To clarify, this only happened in a production build – the development build worked fine – and was therefore extra hard to debug. |
The rule Could you please enable it manually and check whether it reports all problematic cases? |
I scaffolded a new Vue project with I upgraded the ESLint and eslint-plugin-vue versions to the latest stable releases, 8.14.0 and 8.7.1 respectively, so it's present in the latest stable versions. |
Thanks for testing! So the vue/no-expose-after-await rule should be adapted to also catch cases in |
Please describe what the rule should do:
The rule should notify when
defineExpose
is used after any top-levelawait
. Doing so causes problems as described in this core Vue.js issue:vuejs/core#4930
What category should the rule belong to?
[x] Warns about a potential error (problem)
Provide 2-3 code examples that this rule should warn about:
Additional context
The current workaround is to manually remember to place all
await
s afterdefineExpose
. Forgetting to do so leads to problems that are hard to debug. In the context of my examples, a JavaScript error would be thrown whenfoo
is used (foo is not defined
or similar) in some other component and it's unclear the source of the problem is actually in the component definingfoo
.The problem seems challenging to fix in Vue.js itself:
vuejs/core#4930 (comment)
The text was updated successfully, but these errors were encountered: