-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Allow the user to ignore warnings in the script tag #11822
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
Comments
Hm. I'm not sure how we'd want something like this to interact with, for example, ignore comments in ESLint, where I think we're also surfacing these warnings. Presumably a comment like the one proposed in this issue would prevent the compiler from emitting the warning, which would prevent ESLint from knowing about it and reporting it. Would it be confusing to have two ways of doing the same thing? |
|
Oh, I didn't realize this existed in Svelte 4 already. I guess I'm not going to worry then about the two different ways of ignoring warnings. |
Uh actually: some warning can actually be silenced in the script...there are two or three that can't because they are raised after the analysis walked the whole ast based on the bindings. |
Oh right, yeah some are not silenceable right now. Not sure if worth to find workarounds for all of them |
Yeah i was kinda trying to find a solution but it's very difficult because the check needs to happen after the walk but after the I tried to move the I'll try again later |
What if we attach the "ignore information" to node itself? Then the warning function can just check the ignore from the node itself. I remember the will to remove metadata from the nodes tho right? |
It was on the node itself for some time but that had drawbacks, too, in some locations. I think the most practical solution is to keep the current system and add one-off hacks/fixes to those specific warnings - and probably also not all of them. I don't think you want to silence them all (i.e. it makes no sense to ignore some of these anyway) |
I took a shot with an idea that i had...let me know how bad it is 😄 |
Sorry to comment on a closed issue. /**
* Not state related
* @type {object}
* @svelte-ignore non_reactive_update
*/
let a = {} Rather than appending a separate line for |
Describe the bug
As per #11818 (comment) currently there's no way to silence a warning in the script tag.
The user should be able to use the same
svelte-ignore
comments as in the templateReproduction
REPL
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: