Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skipping eslint for files that are on the .gitignore list #8545

Closed
n1ru4l opened this issue Feb 23, 2020 · 1 comment
Closed

Allow skipping eslint for files that are on the .gitignore list #8545

n1ru4l opened this issue Feb 23, 2020 · 1 comment

Comments

@n1ru4l
Copy link
Contributor

n1ru4l commented Feb 23, 2020

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.

@ianschmitz
Copy link
Contributor

We won't be looking in gitignore, but after #8276 goes in you should be able to use a .eslintignore file as expected.

@lock lock bot locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants