-
Notifications
You must be signed in to change notification settings - Fork 3
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
prettier removes eslint disable comments in svelte components #19
Comments
I'm looking into this. Can you help me build a reproducible example? The disable lines in the following example aren't removed when I run <script>
/* eslint-disable no-var, vars-on-top */
import { writable, derived } from "svelte/store";
var value = writable(0);
// eslint-disable-next-line no-unused-vars
$: $value = 5;
const double = derived(value, ($value) => value * 2); // eslint-disable-line no-unused-vars, no-shadow
</script>
<p>Double is {$double}</p> |
I believe I encountered this in an arrow function inside the template itself, for instance something like <button on:click={() => {
acc = acc - 10; // eslint-disable-line
}}>click</button> |
I recognize this might be a limitation of svelte eslint support at this point. |
(I figured it out since CI passes! I just won't do that sort of thing in the future.) |
Ah. Still, that shouldn't happen. Thanks for the help. I opened a bug: |
Thanks for filing, appreciate it. I should have just done that myself. |
No worries. I'll keep track of the issue and close this once it's fixed. |
Note: We can close this after sveltejs/prettier-plugin-svelte#104 is fixed and we upgrade to a version of prettier-plugin-svelte which includes the fix. |
It appears that I cannot make my eslint disable comments survive svelte + prettier. I think this is a new thing, probably from one of the dependabot merges, but this collides with the eslint errors being surfaced in the #18.
The text was updated successfully, but these errors were encountered: