I have some files that are in a certain folder and those files are from a vendor so I cannot control them. I would like to disable eslint for all the files in that directory and all subfolders.
For those converting eslint-disable-next-line to eslint-disable (for multiple lines), remember two things. 1. /* */ instead of // 2. It's eslint-disable and not eslint-disable-next-line . Just reiterating coz I did the same and had to search many more things due to the 2nd point.
You can also disable all ESLint rules by putting /* eslint-disable */ at the top of a file.
To ignore some folder from eslint rules we could create the file . eslintignore in root directory and add there the path to the folder we want omit (the same way as for . gitignore ).
You can add a .eslintignore
in project root directory, and use it the same as .gitignore
, .npmignore
, etc..
When it comes to ignoring multiple files at the same time, we can use **
.
For example: src/**
means ignore all files in [root]/src
.
"ignorePatterns": []
.As of ESLint 6.7.0, you can now pass an Array of paths to a top-level "ignorePatterns"
attribute in your ESLint config in .eslintrc.json
:
{ // The rest of your ESLint config... "ignorePatterns": [ "gists/", "vendor/" ] }
You can read the release announcement from November 2019 here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With