-
-
Notifications
You must be signed in to change notification settings - Fork 48
svelte-ignore reactive-component not working #1192
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
Thank you for this report. For now, I think the only workaround is to disable the |
If it's not a lint that the plugin concerns itself with, then I think the sensible thing is to whitelist it This workaround does indeed work: <!-- eslint-disable-next-line svelte/no-unused-svelte-ignore -->
<!-- svelte-ignore reactive-component --> |
I think it would be a good idea to have a whitelist. Is it possible to create the whitelist? |
I guess I didn't explain it well. |
I'm not sure. I found this list of compiler warnings here (from Svelte 3), but I assume it's hard to tell which would be runtime warnings: https://github.com/sveltejs/svelte/blob/v3.59.2/src/compiler/compile/compiler_warnings.ts |
Yeah. I wish we could figure out which ones are runtime warnings... |
I think there's no easy way tbh |
@baseballyama Do you have any ideas? |
Also, I don’t think there’s a way to suppress runtime warnings using comments. |
I said it was a runtime warning, but that's wrong. It's actually a rendering warning. |
Hmm... something seems different from what I've tried 😓 I'll look into it some more. |
It looks like I was trying with the following code, I forgot what import { compile } from 'svelte/compiler';
import { readFileSync } from 'fs';
const main = () => {
const file = readFileSync('./src/routes/+page.svelte', {encoding: 'utf8'});
console.log(compile(file, {generate: false}))
}
main(); |
The documentation says that
https://svelte.dev/docs/svelte/svelte-compiler#ModuleCompileOptions I think I probably used Shouldn't we use |
The Svelte compiler mainly consists of three steps: parsing, validation, and transform, and it seems that this warning is generated during the transform step. |
This is Svelte5 document, but the OP uses Svelte3/4. |
Just sharing: It seems that language-tools also uses |
I tried the same thing in Svelte 5, but no warning was emitted. |
I think I think it would make sense for us to change the We might be able to lint correctly by removing |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
9.24.0
What version of
eslint-plugin-svelte
are you using?3.5.1
What did you do?
Configuration
Default from
sv create
:What did you expect to happen?
No errors, because this comment works to successfully ignore the
reactive-component
runtime warningWhat actually happened?
Gives this error:
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/probablykasper/svelte-ignore-reactive-component-bug
Additional comments
No response
The text was updated successfully, but these errors were encountered: