Skip to content

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

Closed

Description

@gone-skiing

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.

Activity

  1. 9jaGuy commented on Nov 13, 2020

    @9jaGuy

    this behavior is pre v4

  2. gone-skiing commented on Nov 13, 2020

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

  3. timrbula commented on Nov 13, 2020

    @timrbula

    @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

  4. Lulololu commented on Nov 17, 2020

    @Lulololu

    Hola,

    This #9887 seems to be related to this issue.

  5. ianschmitz commented on Nov 26, 2020

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

  6. gone-skiing commented on Nov 30, 2020

    @gone-skiing
    Author

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

  7. henryruhs commented on Dec 9, 2020

    @henryruhs

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

  8. simpsonphile commented on Jul 21, 2021

    @simpsonphile

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions