-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
[eslint-comments/no-use]: Allow "eslint-disable" only for selected rules (feature request) #71
Comments
Hi. I think you can allow {
"no-restricted-disable": [
"error",
"*",
"!vue/no-bare-strings-in-template"
]
} https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html |
Hi, thx for the hint. First, I tried to use "no-restricted-disable" and it works for rules without slash: "eslint-comments/no-restricted-disable": [
"warn",
"*",
"!no-console"
], but does not work for rules with slash (e.g. "vue/no-bare-strings-in-template") Second, "no-restricted-disable" disallows disabling rule altogether. |
I did not know that 😅
Does that mean that you want to set the rules that can be used with eslint-disable and the rules that can be used with eslint-disable-next-line separately? If so, that may not be possible now. |
Yes.
I see that. This is why I am suggesting new feature. |
Hi @iliubinskii! Since this repo is unmaintained, you might want to re-open this issue in the @eslint-community fork https://github.com/eslint-community/eslint-plugin-eslint-comments For more info about why we created this organization, you can read https://eslint.org/blog/2023/03/announcing-eslint-community-org |
Thx for the plugin.
Is it possible to add "allowEslintDisable" setting that will accept an array of rule names?
Motivation:
Consider "vue/no-bare-strings-in-template" rule that requires that all strings inside template are taken from language file.
Imagine that you have a static untranslated page (e.g. privacy, etc).
In this case, you want to disable "vue/no-bare-strings-in-template" rule for the entire file.
However you may not want to allow global disabling for all other rules.
In this case "allowEslintDisable" option may be helpful.
Similar settings may be added for other allowed syntaxes (e.g. eslint-disable-next-line)
The text was updated successfully, but these errors were encountered: