CRA v4 build with CI=true fails when eslint warnings are present
See original GitHub issueDescribe the bug
After upgrade to v4 of react scripts our CI builds fail due to eslint warnings. In versions 3.x same build passed.
This is problematic for large codebases where there are many pre-existing warnings and we still want to flag them in builds and IDEs to allow engineers to clean them up gradually without blowing up CI builds. We do not want to turn off the rules because the new code they keep us from creating more tech debt. For pre-existing code, it is not feasible to fix all warnings before upgrade to v4.
Steps to reproduce
- Clone this repo. https://github.com/gone-skiing/cra-eslint-warning This is a freshly created app with create-react-app, with single line change to introduce unused variable to simulate eslint warning.
- Install dependencies
npm i
- Run
npm run build
= PASSES (good)
- Run
npm run build-with-ci
= FAILS (bad) The only difference here is CI=true added to the build script.
Expected behavior
It is expected that the build will pass with warnings.
Actual behavior
Build fails which blocks the rest of our pipeline.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
My create-react-app is failing to compile due to ESLint error
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default ......
Read more >"Failed to compile" error for any eslint error. i would like to not ...
i tried using https://github.com/bfanger/eslint-plugin-only-warn to make all errors to warnings, but they are still errors.
Read more >Common React TypeScript ESLint / Lint Errors & Warning ...
In this article, I cover common lint error messages I found in my projects and how I fixed them.
Read more >Untitled
Center 4 arts homer. Rugui brights telefono, Kaneki touka and nishiki or tsukiyama, Monster sets workout routine, Alpha omega books, Jordan mcelmurry, ...
Read more >My create-react-app is failing to compile due to ESLint error ...
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ianmcnally This issue is still present in 4.0.1 - respecting our eslint configuration or not does not change the fact that it fails on warnings…
any update? Failed to compile on dev with ESLINT_NO_DEV_ERRORS=true