Is it possible to turn off the eslint rule for the whole file? Something such as:
// eslint-disable-file no-use-before-define
(Analogous t
To disable specific rules for file(s) inside folder(s), you need to use the "overrides"
key of your .eslintrc
config file.
For example, if you want to remove the following rules:
max-lines-per-function
import/no-unresolved
For all files inside the following main folder:
/spec
You can add this to your .eslintrc
file...
"overrides": [
{
"files": ["spec/**/*.js"],
"rules": {
"max-lines-per-function": ["off"],
"import/no-unresolved": ["off"]
}
}
]
Note that I used **
inside the spec/**/*.js
regex, which means I am looking recursively for all subfolders inside the folder called spec
and selecting all files that ends with js
in order to remove the desired rules from them.