question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide means for disabling all rules from a given plugin within a file

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
atoivcommented, Aug 16, 2017

At the moment, I don’t see any easy way to accomplish what you want.

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.

2reactions
mblodorncommented, Aug 22, 2017

@atoiv could you please share this file?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found