-
-
Notifications
You must be signed in to change notification settings - Fork 208
[PATCH] [10.x] Fix ESLint 6.2.0 + babel-eslint + no-unused-vars false positive with for-in loop #793
Conversation
…1 including ^6.2.0
…ly supports node 6
I had to downgrade eslint dev dependency as the build fails on node 6 (wouldn't it be good to drop support for it with the next major release?) as the ansi-escapes included transitively by eslint@^5.6.0 -> inquirer@^6.2.2 -> ansi-escapes@^4.2.1 declares no support for node 6. |
I am afraid this PR is too board for a patch release. Besides, specifying What happens in #791ESLint accepts custom parser plugin. Here is a brief mind map when using ESLint standalone:
And when using eslint + babel-eslint
A breaking change from When The solution, therefore, is straightforward: always use the same
Why specifying
|
Just want to note that there are alternative package managers like pnpm and others that will break with this assumption. |
We are considering pin the supported ESLint version of babel-eslint v10 to |
There is no issue with peer dependencies as you mention. I have published an example repo - https://github.com/przemyslawzalewski/babel-eslint-peer-dependencies - please run |
We could do something like this: var filename = require.resolve(
"eslint-scope",
{ basedir: require.resolve("eslint") }
);
require(filename); |
This still introduces issues when eslint has a conflicted eslint-scope resides under its own node_modules folder. |
I think @nicolo-ribaudo proposed solution is better:
nit: @przemyslawzalewski Good to know npm works in this scenario! Could you try if |
@JLHwung Sadly but warning " > @przemyslawzalewski/babel-eslint@10.0.3" has unmet peer dependency "eslint-scope@^3.7.1 || ^4.0.0 || ^5.0.0". However, everything works without a hassle: $ yarn run lint
yarn run v1.17.3
$ eslint .
✨ Done in 1.05s. |
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) |
This is a candidate for a PATCH release on the 10.x branch in order to fix the issue with eslint^6.2.0 without introducing any breaking changes.
I have cherry-picked some of the commits from #792 but kept the required changes to the minimum.
I ran tests and lint with eslint^4.12.1, ^5.0.0, ^6.0.0 and ^6.2.0 over this repo and on a project which had the issue with the false-positives.
Fixes:
#791