-
-
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
eslint for...in / for...of false positive #7566
Comments
eslint/eslint#12117 |
Does anyone know of a temporary work-around for this? I tried downgrading and locking I've tried turning off I don't have much experience configuring EDIT Nevermind, I was able to solve it by also locking |
@vincerubinetti for a temporary workaround if you're using yarn you could try the resolutions feature. |
I am seeing the same but for a for-of loop. If this is verified think of renaming the issue so that others facing the same problems can more easily find it.
|
|
#7594 resolves this issue but it not merged/released yet. As a workaround I published it on npm and use it until a newer react-scripts is released with a fix. https://www.npmjs.com/package/@madmed88/react-scripts |
You can also use SKIP_PREFLIGHT_CHECK=true to avoid the issue mentioned by @jwhitlock. For the proper solution see #7594. Let’s get it merged! |
We had just one false positive in our codebase, so a pair of |
Just curious what the ETA is for publishing the patch? |
Describe the bug
ESlint shows a no-unused-vars false positive with for-in loops.
Looks very similar to eslint/eslint#12117
This issue didn't exist in react-scripts@3.0.0
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
N/A
Environment
Unfortunately, running
npx create-react-app --info
throws the error shown further down.I'm using react-scripts@3.1.1
Error from
npx
commandEnvironment Info:
(node:612) UnhandledPromiseRejectionWarning: Error: The system cannot find the path specified.
(node:612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Steps to reproduce
Create a simple function in your CRA project with something like:
Run
npm start
Expected behavior
No ESLint warnings should be shown.
item
is used.Actual behavior
Compiled with warnings.
./src/utils/file.js
Line 3: 'item' is defined but never used no-unused-vars
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: