Visitar URL original
Map ESLint's `sourceType: commonjs` to script by JLHwung · Pull Request #17349 · babel/babel · GitHub
Skip to content

Map ESLint's sourceType: commonjs to script - #17349

Merged
JLHwung merged 1 commit into
babel:mainfrom
JLHwung:support-eslint-source-type-commonjs
Jun 1, 2025
Merged

JLHwung merged 1 commit into
babel:mainfrom
JLHwung:support-eslint-source-type-commonjs

Conversation

@JLHwung

@JLHwung JLHwung commented May 30, 2025

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? Fixes #17347
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

In this PR we support the sourceType: "commonjs" option introduced in ESLint 9. Since Babel parser does not have a commonjs source type, here we change the commonjs to the script source type.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: eslint labels May 30, 2025
@babel-bot

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59481

@nicolo-ribaudo nicolo-ribaudo changed the title initial support for ESLint sourceType: commonjs Map ESLint's sourceType: commonjs to script May 31, 2025
@JLHwung
JLHwung merged commit 0c51d8f into babel:main Jun 1, 2025
@JLHwung
JLHwung deleted the support-eslint-source-type-commonjs branch June 1, 2025 12:00
noelportillo

This comment was marked as spam.

@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 Sep 14, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: eslint outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] When sourceType is unspecified then babel gives "Parsing error" with ESLint 9 flat config on '.cjs' files

5 participants