-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
react-scripts no longer prints ESLint warnings #10509
Comments
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 For example, with this code: const x = 42; And the rule: "@typescript-eslint/no-unused-vars": "error" I get the following console output: And the following error in the App Overlay 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. |
@miguelCT I faced the same issue today. I set Can this behavior be due to an extended Eslint config? |
For me it works as expected on react-scripts@v4.0.2: And same with steps provided by @miguelCT: I get a warning in the console and no error overlay in the app Env info:
|
I no longer receive any eslint warnings in the console. |
@DimaDK02 are you sure you are using v4.0.2 of CRA? I see in your Environment info about v3.4.1, but I'm not sure if that info is related to your system. Just to add more information, in my case the Environment info is:
|
@miguelCT, it's just a version of globally installed create-react-app. Locally, in the node_modules I have react-scripts@4.0.2. BTW, in the env info of @asterikx I see |
I've created a CodeSandbox Container with the same instance of CRA that I have locally and the result is the same. Envirnonment info of the Sandbox
Link: https://codesandbox.io/s/cra-402-eslint-errors-bfwgl?file=/.eslintrc.json:43-92 Important: ignore the VsCode hints/warnings for TS in that container files. Right now, VsCode in these containers only accepts Typescript 4.1.2, but the environment and project configuration is correct (with TS 4.1.3) As you can see in the console and the running app (overlay) there's and error due to an used variable. This error has been converted by CRA to a warn thanks to the |
This seems to be related to this release: https://github.com/webpack-contrib/eslint-webpack-plugin/releases/tag/v2.5.0 @miguelCT Running |
Thanks for the possible solution @romamd. Downgrading works as expected. I still think that this is an issue with CRA in the current 4.0.2 version, because it should work out of the box without me having to downgrade some dependencies. There is this temporal solution, yeah, but as @DarkAce65 was also pointing out here, something is still not working as expected with the current CRA internal configuration. |
Yeah, I think that PR unintentionally disabled warnings when you don't use the FWIW my solution was to just pin
|
@DarkAce65 Don't think downgrading react-scripts to 4.0.1 can help with that issue, ESLINT_NO_DEV_ERRORS was introduced in 4.0.2 release |
Ah to be clear, these warnings are not showing up when @romamd the PR that @miguelCT linked was introduced in |
@DarkAce65 The problem is that |
@romamd oh weird, I can run some more tests later today on those two versions but I was correctly seeing errors being converted to warnings with Since I wasn't planning on using |
I was also getting no eslint warnings at all after upgrading react-scripts 4.0.1 to 4.0.2. |
Yeah, I did some more testing and made a reproducible example repo (https://github.com/DarkAce65/cra-eslint-warnings) and brought it up in #10170. TLDR is that the combination of |
It's reproducible with a fresh install as well: |
I also am seeing this with a project that was freshly upgraded to CRA 4.0.2 from 3.x today. Running npm i eslint-webpack-plugin@2.4.3 --save-dev -E worked to restore warnings as expected. |
Hey all, just a heads up, it looks like this issue was fixed in #10590 and released in |
I can confirm too, that the issue does no longer exist in |
I did not see any warnings in my project because my package.json was missing
Probably I missed something in the relase notes and forgot to add this at some point. |
I was using Unfortunately Any updates about the fixes? thanks |
@HurYur Did you try to remove the .cache folder once? |
@receter yeah, it helped with the initial warnings representation in the terminal, but still doesn't represent any warnings in the Browser console.. |
@HurYur Having the same problem on 5.0.1. Did you end up with a fix? |
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
Steps to reproduce
"@typescript-eslint/no-unused-vars": "warn"
in the eslint configconst x = 42
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.
The text was updated successfully, but these errors were encountered: