-
Notifications
You must be signed in to change notification settings - Fork 335
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
Allow eslint.rules.customizations to target all fixable rules #1705
Conversation
@microsoft-github-policy-service agree |
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "info" }` | ||
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "error" }` | ||
- Suffix the name with `"@hasFix"` to target the errors which that have autofix available `{ "rule": "no-*@hasFix", "severity": "info" }` | ||
- Suffix the name with `"!@hasFix"` to target the errors which that _don't_ have autofix available `{ "rule": "no-*@!hasFix", "severity": "error" }` |
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.
Missed a "!@hasFix" typo here
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "info" }` | ||
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "error" }` | ||
- Suffix the name with `"@hasFix"` to target the errors which that have autofix available `{ "rule": "no-*@hasFix", "severity": "info" }` | ||
- Suffix the name with `"!@hasFix"` to target the errors which that _don't_ have autofix available `{ "rule": "no-*@!hasFix", "severity": "error" }` |
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.
Instead of a suffix on the existing rule
property, how about a new property like "fixable"
? The suffix is confusing me and won't scale well if more features like it are asked for, such as filtering on whether it provides suggestions or what it's meta.type
is.
Proposal:
"eslint.rules.customizations": [
{ "rule": "*", "severity": "warn", "fixable": true },
]
(caveat: I'm not a VS Code or vscode-eslint maintainer, just the external contributor from #1164 & stumbled onto this)
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.
@JoshuaKGoldberg I actually like this a lot. I am not really happy with the !@hasFix
suffix either.
With the config like this: ``` "eslint.rules.customizations": [ { "rule": "*", "fixable": true, "severity": "info" } ] ``` It'll downgrade all autofixable problems to the info severity. Fixes microsoft#1634 Rel microsoft#267, microsoft#680, microsoft#655, microsoft#1705
Implemented in #1841 |
Closes #1634
Related: #267 , #680