Description
Is your proposal related to a problem?
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.