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

CRA v4 build with CI=true fails when eslint warnings are present #10062

Closed
gone-skiing opened this issue Nov 12, 2020 · 8 comments
Closed

CRA v4 build with CI=true fails when eslint warnings are present #10062

gone-skiing opened this issue Nov 12, 2020 · 8 comments

Comments

@gone-skiing
Copy link

gone-skiing commented Nov 12, 2020

Describe 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

  1. 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.
  2. Install dependencies npm i
  3. Run npm run build = PASSES (good)

Screen Shot 2020-11-12 at 5 48 39 PM

  1. Run npm run build-with-ci = FAILS (bad)
    The only difference here is CI=true added to the build script.

Screen Shot 2020-11-12 at 5 48 56 PM

Expected behavior

It is expected that the build will pass with warnings.

Actual behavior

Build fails which blocks the rest of our pipeline.

@9jaGuy
Copy link

9jaGuy commented Nov 13, 2020

this behavior is pre v4

@gone-skiing
Copy link
Author

@9jaboy checking... It looks like you are correct. There is also this discussion from years ago on the topic #3657

We are definitely seeing builds break after upgrade to v4 that passed on v3.4.1 but it could be something different on our end.

@timrbula
Copy link

@gone-skiing The linting rules changed with 4.0 and that is likely the source of new warnings that will fail a CI build. We noticed a few in our apps for the new rule import/no-anonymous-default-export (which is a good change for dev tooling purposes as I understand it)

See the breaking changes section in the release notes: https://github.com/facebook/create-react-app/releases/tag/v4.0.0

@Lulololu
Copy link

Lulololu commented Nov 17, 2020

Hola,

This #9887 seems to be related to this issue.

@ianschmitz
Copy link
Contributor

This has been the behavior of our lint warnings for a few years now. You may just be noticing that we respect your eslint configuration now which is new in 4.0

@gone-skiing
Copy link
Author

@ianschmitz gotcha, that makes sense - we were trying to figure out what changed.

@henryruhs
Copy link

henryruhs commented Dec 9, 2020

@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...

@simpsonphile
Copy link

simpsonphile commented Jul 21, 2021

any update?
Failed to compile on dev with ESLINT_NO_DEV_ERRORS=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants