Skip to content

fix(parser): disallow declare module M {}#18120

Merged
JLHwung merged 3 commits into
babel:mainfrom
JLHwung:fix-ts-declare-module
Jul 8, 2026
Merged

fix(parser): disallow declare module M {}#18120
JLHwung merged 3 commits into
babel:mainfrom
JLHwung:fix-ts-declare-module

Conversation

@JLHwung

@JLHwung JLHwung commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? Forbids declare module M {}
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 reused the error InlineModuleDeclarationMustUseString for such cases. Also added new tests and updated the parser test results.

@JLHwung JLHwung added PR: Spec Compliance 👓 A type of pull request used for our changelog categories pkg: parser area: typescript labels Jul 6, 2026
@babel-bot

babel-bot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: 18b92a3

@JLHwung JLHwung merged commit 1cd94d4 into babel:main Jul 8, 2026
57 checks passed
@JLHwung JLHwung deleted the fix-ts-declare-module branch July 8, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: typescript pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants