-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Change babel/eslint-parser's inclusion of eslint-scope to be compatible with ESlint #13058
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44778/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5d6f7a5:
|
@arcanis Would something like |
I don't remember if const {createRequire} = require(`module`);
const eslintReq = createRequire(require.resolve(`eslint`));
const eslintScope = eslintReq(`eslint-scope`); |
In babel/babel-eslint#794 (comment) the maintainer of ESLint @mysticatea recommend |
PnP is perfectly fine with that snippet, it's basically what babel does already to load plugins and presets |
Right, I didn't think about that! |
Thank you for the approvals & merge. |
eslint-scope is included as a dependency within
@babel/eslint-parser
using exact matching, i.e. only5.1.0
.However since before ESLint version 7.5.0, ESLint has specified
eslint-scope
as^5.1.0
, and in more recent versions it is^5.1.1
. This means multiple versions can end up in the node dependency tree for those using ESLint with Babel, potentially causing conflicts or other issues.This PR updates the dependency to match that of ESLint, so that the dependency tree for projects will only have one version of
eslint-scope
.