-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add possibility to silence module-script-reactive-declaration
warning
#5954
Comments
IMHO, just don't warn on |
And functions too |
Agree. I'm exporting a const to use the value in other modules, and that's causing this warning too. I suppose workarounds are to make this a readable store (which seems a lot heavier than just exporting a const), or creating a constants.js file that gets imported in multiple places. |
I don't see the point of this warning. A warning should be emitted if the code can be improved or if something is wrong. This warning sounds like "read the doc". |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant |
including css-unused-selector, unused-export-let, module-script-reactive-declaration Fixes sveltejs#5954 Related to sveltejs#5281
This has been released in 3.39.0. |
Is your feature request related to a problem? Please describe.
In #5847 I expressed the concern that people might want to use module variables inside reactive statements, knowing that reactivity will not be triggered on changes to them. This means it should be possible to silence the warning.
Describe the solution you'd like
<!-- svelte-ignore module-script-reactive-declaration -->
at the top of the component or// svelte-ignore module-script-reactive-declaration
should silence the warningHow important is this feature to you?
Nice to have to not have this warning make unnecessary noise
Workaround in the meantime
You can globally silence this. For
svelte-check
, do--compiler-warnings "module-script-reactive-declaration:ignore"
. A similar option is available for the VS Code extension.The text was updated successfully, but these errors were encountered: