-
Notifications
You must be signed in to change notification settings - Fork 45
Ignoring lint rules in templates #22
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
Having this plugin explicitly disable the I'm not sure what to do about the Adding back an option to disable template linting entirely would probably make things smoother but it doesn't feel like the best move. I'm also worried about adding a general 'do you want to disable this message' callback in the settings, that's passed a |
|
I agree with you about limiting fixes to built-in ESLint rules only. Easier to maintain and keeps the scope of integration testing tight. Yeah, adding an option to disable template linting feels like a step in the wrong direction. Svelte doesn't have first-class TypeScript support yet so The eslint-plugin-jsdoc has a similar problem and have a solution; They have a Not sure how viable it would be for this plugin but I can imagine setting svelte template expressions to pass a For anyone running into the same original issue, you don't need to disable '@typescript-eslint/indent': ['error', 2, {
ignoredNodes: ['Identifier'], // Svelte template expressions
}
] You could probably use a more specific AST pattern but this is better than nothing. |
Processors in ESLint 6 got a bit of a overhaul, including a new feature called named code blocks, which seem like now the correct way to expose the ability to have different configurations for different sections of a Svelte component. I have a pending question about how these work, but in the meantime I have an implementation that uses these in my fork of this plugin. |
This is implemented in 2.7.0 via named code blocks. |
Adding named code blocks was actually a breaking change 😬 I've released 2.7.1 where they're disabled by default, but they can be enabled with |
It works. We can now create presise overrides 🎉 So useful, thank you! |
Now that
v2.0.0
has template linting is on by default, I'm getting a bunch of false negatives I'd like to either ignore or customise specifically for templates.The main 2 I'm seeing (based on my rule set) is:
no-unused-expressions
- We kind of actually want the opposite, templates should be an expression.@typescript-eslint/indent
(same asindent
) - Triggers inside an{#each}
loop.Configs:
The text was updated successfully, but these errors were encountered: