question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-scripts no longer prints ESLint warnings

See original GitHub issue

Describe the bug

After upgrading to react-scripts@4.0.2, react-scripts start no longer prints ESLint warnings (both to the terminal and browser console), while it still prints ESLint errors.

Did you try recovering your dependencies?

1.22.10

Which terms did you search for in User Guide?

None.

Environment

Environment Info:

  current version of create-react-app: 4.0.1
  running from /Users/erikmuller/.config/yarn/global/node_modules/create-react-app

  System:
    OS: macOS 11.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Browsers:
    Chrome: 88.0.4324.150
    Edge: Not Found
    Firefox: 84.0.2
    Safari: 14.0.3
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Make sure to have "@typescript-eslint/no-unused-vars": "warn" in the eslint config
  2. Add unused variable somewhere in your code, e.g. const x = 42
  3. Run yarn react-scripts start

Expected behavior

React Scripts prints both ESLint errors and warnings.

Actual behavior

React Scripts only prints ESLint errors but no warnings.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:24

github_iconTop GitHub Comments

9reactions
miguelCTcommented, Feb 5, 2021

I’m not sure if what happens to me is the same but, even though I have the ESLINT_NO_DEV_ERRORS (v4.0.2) env variable set to true, and the ESlint errors are transformed to ESlint warnings, the build is still not successful and I get a Failed to compile. message.

For example, with this code:

const x = 42; 

And the rule:

"@typescript-eslint/no-unused-vars": "error"

I get the following console output:

image

And the following error in the App Overlay

image

What I understood about the ESLINT_NO_DEV_ERRORS env is that, even if I have ESlint errors in my code, those errors would be transformed to warnings and therefore the App compilation would be successful, printing those in console. Have I maybe misunderstood or is it possibly a bug?

2reactions
romamdcommented, Feb 10, 2021

This seems to be related to this release: https://github.com/webpack-contrib/eslint-webpack-plugin/releases/tag/v2.5.0

@miguelCT Running npm i eslint-webpack-plugin@2.4.3 --save-dev -E fixed it for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint warnings no longer appear in create-react-app terminal
I know I have code that used to throw warnings, but now I always get the same message no matter what: Compiled successfully!...
Read more >
Create-react-app not showing any eslint warnings/error (code ...
Hi, so I'm working on a couple of side projects and in every one of them, everything works great. In this one, (inside...
Read more >
Find and fix problems in your JavaScript code - ESLint ...
ESLint fixes are syntax-aware so you won't experience errors introduced by traditional find-and-replace algorithms. Learn more about fixing problems ...
Read more >
react-scripts | Yarn - Package Manager
react -scripts. #12245 fix: webpack noise printed only if error or warning (@Andrew47) · create-react-app. #11915 Warn when not using the latest version...
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
ESLint section. Linting and pretty-printing JavaScript code can help developers catch errors early, make code more legible, and improve ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found