disable rules for certain file paths or extensions
See original GitHub issueI’m using Cypress and Jest with the ESLint plugins for both, and the Jest plugin is complaining about consistent-test-it
and expect-expect
inside the .spec.js files which are Cypress tests (Mocha syntax).
Being able to specify the file extension to lint would allow these rules to live together in one config.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Turning off eslint rule for a specific file - Stack Overflow
1) Disabling "All rules" · You can go with 1.2 and add /* eslint-disable */ on top of the files, one by one....
Read more >How to disable ESLint for some lines, files or folders
In this tutorial, you'll learn how to turn off ESLint for certain directories ... To disable not all, but only some specific ESLint...
Read more >Ignoring Code - ESLint - Pluggable JavaScript Linter
You can tell ESLint to ignore specific files and directories using ignorePatterns in your config files. ignorePatterns patterns follow the same rules as...
Read more >eslint-plugin-import/extensions.md at main - GitHub
ESLint plugin with rules that help validate proper imports. ... Some file resolve algorithms allow you to omit the file extension within the...
Read more >Configure and validate exclusions based on extension, name ...
Using PowerShell to add or remove exclusions for files based on the extension, location, or file name requires using a combination of three ......
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
You can specify
plugins
, but notextends
, inoverrides
(I think? If not, just specify all the plugins in the root - unless you activate rules, they don’t really do anything)You should either:
require('eslint-plugin-jest').configs.recommended
and use that however you want)root: true
in them)I don’t think it makes sense for us to figure out how to do our own filtering of rules on top of eslint’s current mechanics for it. So I’ll close, but feel free to continue the discussion. As mentioned above, a PR with instructions on how to do it is welcome if you think whatever solution you come up with should be shared 😃
I am curious about this too, having run into a similar issue in a personal project, but I have not yet explored using ESLint’s
overrides
option. Have you tried this out yet? I would encourage you to play around with that configuration, and if you are able to find a solution, we could definitely add that helpful information to the README (only enabling eslint-plugin-jest for certain files using a shared config). Please let us know what your findings are! 😄