Open hamilton opened 4 years ago
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 npm run format
:
<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:
https://github.com/sveltejs/prettier-plugin-svelte/issues/104
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 https://github.com/sveltejs/prettier-plugin-svelte/issues/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.