You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow skipping eslint for files that are on the .gitignore list #8545
It is not possible to disable eslint for files inside the .gitignore. When having generated files you will have to append an eslint-disabled header.
Describe the solution you'd like
Add a new option that can be set via an environment variable that behaves the same as eslint --ignore-path .gitignore "path/to/file".
This could be ESLINT_IGNORE_PATH=.gitignore or GITIGNORE_SKIP_ESLINT=true.
Describe alternatives you've considered
You could manually add the eslint-disabled header. However, this might be cumbersome as some tools (such as the typescript compiler) do not allow automatic adding headers. You will have to write some glue code around those libraries.
Also adding the file to the .gitignore and the .eslintignore is possible, however, I would prefer to only maintain one list.
Additional context
I am partially migrating a javascript code-base to typescript. I added an src_ts folder that is compiled into src. This is the only way that does not require ejecting. I run a typescript watcher (yarn tsc --build src_ts/tsconfig.json --watch) that will compile those files into src. On CI the build fails because react-scripts complains about eslint warnings that occur in the compiled files.
Activity
ianschmitz commentedon Feb 27, 2020
We won't be looking in gitignore, but after #8276 goes in you should be able to use a .eslintignore file as expected.