-
-
Notifications
You must be signed in to change notification settings - Fork 208
Fix ESLint 6.2.0 + babel-eslint + no-unused-vars false positive with for-in loop #792
Conversation
The corresponding issue on eslint has 94 upvotes so seem this issue affects a lot of users. Any chance we can get this merged soon? |
I updated our shared eslint config, which unblocks upgrading eslint and related packages over here. I had to temporarily disable the `no-unused-vars` rule because of this issue: eslint/eslint#12117 we should be able to remove the rule once this PR merges: babel/babel-eslint#792. I'm watching that PR so I'll get notified and open a small PR here when it merges. pr #2168
Any news on when this can be merged and released? |
I have proposed another PR as a PATCH change that should be easier to integrate and I hope it will be merged soon. https://www.npmjs.com/package/@przemyslawzalewski/babel-eslint/v/10.0.3 Usage is simple as changing some entires in a package.json: There is also a fork of the not yet released ^11 branch, however, it may include some breaking changes: |
Thanks everyone for the help and @przemyslawzalewski for the PRs! Went ahead and ended up going with @JLHwung's PR #794 which uses ESLint's deps instead of going with peerDeps since it really depends on the version being used and we don't want users to have to install it directly on their own. Comment here: #791 (comment) |
In order to reach Espree 6 compatibility, I have manually included the changes by proposed by golopot at #785. This is a candidate for a major release.
I have fixed a single broken test case of a super call being called from regular function and added two test cases - one that validates the
no-unused-vars
works as expected when there is a real issue and another for the false-positive case that caused the breakage.To make the linting and tests passes on the repo itself, I have removed self-reference on a broken
babel-eslint
version by just extending the base config with the current one.These changes fix the false positives introduced with ESLint 6.2.0 and they occur no more when using the forked version.
Fixes:
#791