-
Notifications
You must be signed in to change notification settings - Fork 348
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
Implement "eslint.rules.customizations" - Allow users to override rule severity from VS Code settings #993
Implement "eslint.rules.customizations" - Allow users to override rule severity from VS Code settings #993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for starting working on this.
I saw that you already implemented having more than one customization. Although I started this settings wise as a literal we should convert that to an array to be able to specify order. For example:
[
{ rule: "no-extra-semi", severity: "info" },
{ rule: "*", severity: "warn" }
]
We could then also use the ! to negate rules (like in .gitignore files
Does that make sense.
Aah ok, that's very granular. I'll admit I don't really see a usecase for So If I'm understanding it right: something like this, where
In such a case I feel having a severity of 'ignore' would be clearer and wouldn't need the |
|
Aah, I didn't fully understand what "negating" a rule meant in this context. In retrospect I think it means to 'ignore' an override (i.e. rule 1 is Initially I was thinking you meant add the ability to filter out rules, which I guess is possible as well but I don't see anyone having a usecase for that. |
Absolutely corret. |
Ping @dbaeumer @jamesorlakin, is this still something either of you are working on? This is a big pain point for me (& others) so I'd be very interested in picking up this work if neither of you have time? |
I am not actively working on this right now. |
Hi @JoshuaKGoldberg, this is something I admit I've forgotten as my work has largely moved to Java nowadays! Sorry about that. You're welcome to continue, or I can have a look at continuing during the next weekend. It's the 'negating' logic that was left to do, though I assume it doesn't need to be that advanced. |
Continued in #1164 🤗 |
@JoshuaKGoldberg thanks for picking this up again! |
Closing in favour of #1164. Thanks ever so much @JoshuaKGoldberg! |
This hopefully closes #468 based on the discussions in #561.
This PR implements a new extension option, allowing diagnostics reported by the ESLint extension to be overridden by user settings within VS Code. The main usecase is to allow linting errors to be visually different to actual typing/compilation problems based on personal preference, especially if adjusting the ESLint configuration itself is difficult (e.g. it's prepackaged, StandardJS, etc) or there's a fear of committing these customizations accidentally.
For example, the playground environment in this PR:



The
eqeqeq
rule is an error in ESLint parlance, but the*
override forces it to be a nicer yellow warning. I personally prefer this representation of all linting warnings.All comments are welcome.