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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: @babel/estlint-parser fails in projects relying on parserOverride #13915

Closed
1 task
birdofpreyru opened this issue Nov 1, 2021 · 4 comments 路 Fixed by #13918
Closed
1 task

[Bug]: @babel/estlint-parser fails in projects relying on parserOverride #13915

birdofpreyru opened this issue Nov 1, 2021 · 4 comments 路 Fixed by #13918
Labels
area: eslint i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@birdofpreyru
Copy link

birdofpreyru commented Nov 1, 2021

馃捇

  • Would you like to work on a fix?

How are you using Babel?

@babel/eslint-parser

Input code

@babel/eslint-parser fails if Babel config in the host project relies on any preset / plugin using parserOverride. This happens because @babel/eslint-parser itself uses it to capture Babel options. Although there seems to be some code in place to safeguard against "More than one plugin attempted to override parsing" error when some other parsers/plugin rely on parserOverride, it does not seem to help in practice.

Configuration file name

No response

Configuration

No response

Current and expected behavior

@babel/eslint-parser fails to work in the described scenario, it should work though.

Environment

Babel 7.16.0

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @birdofpreyru! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 2, 2021

  • This is probably a regression from when I refactored @babel/eslint-parser. Do you know if an older version worked?
  • Could you provide a repository I can clone to debug this issue? 馃檹

@birdofpreyru
Copy link
Author

@nicolo-ribaudo I don't know: before v7.16.0 (and #13782) it was not working for me (in my first-to-go project for testing risky upgrades) because of #13060.

@nicolo-ribaudo
Copy link
Member

This was a silly error: after catching the error for the duplicate parserOverride, I was re-running Babel with the same options so it always threw again 馃槵

PR: #13918

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: eslint i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants