Disable eslint for all files in a directory and subdirectories

I have files that are in a specific folder, and these files belong to the provider, so I can not control them. I would like to disable eslint for all files in this directory and all subfolders.

+13
source share
2 answers

You can add .eslintignore to the project root directory and use it just like .gitignore , .npmignore , etc.

When it comes to ignoring multiple files at once, we can use ** .

For example: src/** means to ignore all files in [root]/src .

+24
source

I needed a flag to temporarily exclude | disable | ignore the directory. I tried eslint --help | grep exclude eslint --help | grep exclude eslint --help | grep exclude eslint --help | grep exclude no avail.

Then I asked Google for the eslint exclude directory, and the first SO result pointed me to Disable eslint rules for the folder, and my answer was not found there and not here, so maybe someone else is looking for the word "exclude", which in this context is completely replaced by "disable".

Finally, in the ESLint CLI docs, I found the following:

  • --ignore-path
  • --ignore-pattern
  • --no-ignore

I hope this helps someone (who might think of a quick SO hit before ... documentation).

0
source

Source: https://habr.com/ru/post/1266276/


All Articles