Cannot use `.eslintignore` for generated files
See original GitHub issueDescribe the bug
When running yarn start
, the ESLint errors are shown from files I have ignored with .eslintignore
and the app won’t start.
Did you try recovering your dependencies?
Reproducible in a fresh new project.
Which terms did you search for in User Guide?
eslintignore (yielded https://github.com/facebook/create-react-app/issues/6871)
Environment
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
Internet Explorer: 11.0.17763.1
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: 3.0.1 => 3.0.1
npmGlobalPackages:
create-react-app: Not Found
Expected behavior
To ignore specified files from ESLint checks and start the app. Talking here mostly about generated files which we cannot just modify with the comment to disable eslint. The best course of action is to just ignore these.
Quite an exhaustive issue https://github.com/facebook/create-react-app/issues/6871 talks about customizing ESLint config, but not much of the mention of utilizing .eslintignore
which isn’t exactly huge customization and shouldn’t be prohibited like that.
I can use a workaround with cra-override
, but I don’t want to disable a conflicting rule for a whole project when the only a bunch of generated files is affected.
Actual behavior
I have VSCode properly working with ESLint in the project. The specified file is correctly ignored there.
Reproducible demo
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:9 (2 by maintainers)
Top GitHub Comments
I too suggested removing this pesky
ignore: false
in the webpack config in https://github.com/facebook/create-react-app/pull/7036. My use case is for ignoring manually vendored JS libs insrc
.Change should be fully backwards compatible.
I think it makes sense to re-evaluate whether this is viable, given that we are working towards allowing custom eslint configs. However it is a breaking change so it would only be included in a major release that might be a while away.