Provide means for disabling all rules from a given plugin within a file
See original GitHub issueI’ve been using the eslint angular plugin which works great, but some of my files aren’t angular ones which causes it to get conffused, it would be great if I could disable all rules associated with it within a given file using something like this:
/*eslint "angular/*": 0*/
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Turning off eslint rule for a specific file - Stack Overflow
1) Disabling "All rules" ... Two ways you can do this: ... There are 3 ways you can do this: You can go...
Read more >Rules - ESLint - Pluggable JavaScript Linter
Rules are the core building block of ESLint. A rule validates if your code meets a certain expectation, and what to do if...
Read more >Authoring Tasks - Gradle User Manual
You often need to locate the tasks that you have defined in the build file, for example, to configure them or use them...
Read more >Configuring ESLint - ESLint - Pluggable JavaScript linter
All of these options give you fine-grained control over how ESLint treats your ... Environments can be specified inside of a file, in...
Read more >Administration — Err 9.9.9 documentation - Errbot
If you want to prevent a plugin from being loaded at all during bot startup, the !plugin blacklist <plugin name> command may be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this still the case?
Another use case where disabling all rules of a plugin would help is with external eslint-configs that use multiple plugins and provide rule configurations for these plugins.
Sometimes there’s a lot of plugins used in a single eslint-config. For a specific project, it’s possible that one of the plugins is either problematic, or just not useful, and would need to be disabled.
Example use case:
Popular config eslint-config-airbnb uses, among other plugins, the magnificent accessibility plugin eslint-plugin-jsx-a11y. Even though eslint-plugin-jsx-a11y is a real gem when creating sites facing the world wide web, it is no use in a closed environment, such as electron, where aria rules are not supported. As the generated dom is only read with a single non-aria-supporting program, enforcing rules for aria is no use, and only amounts to a lot of unnecessary work and code.
The workaround that we have taken is to add an extra config file, which disables all eslint-plugin-jsx-a11y rules, into our own eslint-config repo. The problem here is, we need to keep our own config file for disabling eslint-plugin-jsx-a11y updated with all the breaking changes to eslint-plugin-jsx-a11y, in versions that eslint-config-airbnb might want to support.
While this is doable, the proposed solution in this issue, or a similar core eslint solution, would be far easier and safer alternative.
@atoiv could you please share this file?