-
-
Notifications
You must be signed in to change notification settings - Fork 208
ESLint 6.2.0 + babel-eslint + no-unused-vars false positive with for-in loop #791
ESLint 6.2.0 + babel-eslint + no-unused-vars false positive with for-in loop #791
Comments
Seems the |
if update it to v6.2.0, following code doesn't pass ESLint ```js const list = ['a', 'b', 'c']; for (const i in list) { // <- no-unused-vars "error 'i' is defined but never used" console.log(i); // <- WE USE IT IN THIS LINE!!!!!! } ``` See: https://twitter.com/fetus_hina/status/1163416507138768896 https://twitter.com/fetus_hina/status/1163417546676039681 https://twitter.com/fetus_hina/status/1163421886543323136 #550 eslint/eslint#12117 babel/babel-eslint#791
FYI I tried upgrading |
Maybe related, having the same problem with import scenarios from './scenarios';
for (const scenario of scenarios) {
doSomethingWithScenario(scenario);
} Get an eslint error:
With
|
According to the original eslint issue eslint/eslint#12117
|
Just wanted to note that ESLint 6.2.1 contains an important security fix (see: https://eslint.org/blog/2019/08/eslint-v6.2.1-released) but it's not possible to upgrade to 6.2.0 or later until this issue is fixed. |
For those who are curious about why ESLint 6.2 + babel-eslint does not work and how we may solve it on |
Ok merged #794 thanks to everyone and @JLHwung for the PR, released as 10.0.3. Not an easy package to maintain for sure given it's patching the packages themselves. Ideally we'll have better hooks for these things in the future. Can also do one for v11 beta. I verifed with one of the test cases on 10.0.2 and it failing and passing with 10.0.3. Let us know if this issue still persists! Thanks! |
There's a new issue in ESLint 6.2.0 just caught by the
standard
test suite. This may be an issue withbabel-eslint
, though I am not sure since the issue did not exist in ESLint 6.1.0. Here's a pointer to the issue I filed with ESLint: eslint/eslint#12117The text was updated successfully, but these errors were encountered: