Closed maxmilton closed 5 years ago
What I ran into with /* eslint indent: 'off' etc */
was that the rules were actually disabled for the entire file, not just for the code below them. I confirmed in the ESLint Gitter that that is how they're intended to work. The benefit of the /* eslint-disable etc */
is that it only affects the code that follows, and we do want these linting rules in effect for the part in the <script>
tag.
I'm not sure what can be done about this. Maybe I'd be able to purposefully put in code that would break those rules so the unused disables errors aren't thrown. Or maybe I'll have to split up the Svelte components into two processed files (one for the script blocks and one for the template expressions), and have those linted separately.
This should be fixed in 2.2.2.
Confirmed fixed in 2.2.2
. Thank you.
I like that you've consolidated all the rule exception handling into one place. The plugin feels cleaner and less hacky :)
Another issue related to ignored rules in svelte template, similar to https://github.com/sveltejs/eslint-plugin-svelte3/issues/22
When running ESLint from the CLI with the
--report-needless-disables
flag it throws a heap of errors:This happens because svelte templates get
/* eslint-disable indent, no-unused-expressions, quotes */
injected along in with the transformed code.A possible fix is to use this instead: