Skip to content
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

Bug: using babel-eslint parser throws error #15157

Closed
1 task
ais-one opened this issue Oct 13, 2021 · 2 comments
Closed
1 task

Bug: using babel-eslint parser throws error #15157

ais-one opened this issue Oct 13, 2021 · 2 comments
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects

Comments

@ais-one
Copy link

ais-one commented Oct 13, 2021

Environment

Node version: 14.18.0
npm version: 6.14.15
Local ESLint version: v8.0.0
Global ESLint version: Not Found
Operating System: win32 10.0.18363

Also "babel-eslint": "^10.1.0",

What parser are you using?

Other

What did you do?

  1. create a project using npm init
  2. install eslint and babel-eslint
  3. eslint --init settings: CommonJS, Not using react or vue, No typescript, run on node, use JS for config file
  4. create a simple console.log('hello world') JS file
  5. add parser: 'babel-eslint' to .eslintrc file
  6. run the lint

What did you expect to happen?

No error when linting

What actually happened?

get the error below

  0:0  error  Parsing error: Must use import to load ES Module: C:\Users\aaron\test\cookbook\js-node\expressjs\node_modules\eslint-scope\lib\definition.js
require() of ES modules is not supported.
require() of C:\Users\aaron\test\cookbook\js-node\expressjs\node_modules\eslint-scope\lib\definition.js from C:\Users\aaron\test\cookbook\js-node\expressjs\node_modules\babel-eslint\lib\require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename definition.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\aaron\test\cookbook\js-node\expressjs\node_modules\eslint-scope\package.json

When I remove the parser: 'babel-eslint'. The linting runs without error...

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@ais-one ais-one added bug ESLint is working incorrectly repro:needed labels Oct 13, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Oct 13, 2021
@btmills btmills added 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser and removed bug ESLint is working incorrectly repro:needed labels Oct 13, 2021
@btmills
Copy link
Member

btmills commented Oct 13, 2021

Support for ESLint v8 in @babel/eslint-parser is being tracked in babel/babel#13712, and you can subscribe to that issue for updates. We’ll leave this issue open for visibility.

@snitin315
Copy link
Contributor

Resolved in babel/babel#13782

Triage automation moved this from Blocked to Complete Dec 12, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 11, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

3 participants