fix(parser): reject module-referencing imports/exports in a namespace body#22829
Merged
Conversation
This was referenced May 29, 2026
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
4f6f0dd to
56b18d9
Compare
Member
Author
Merge activity
|
56b18d9 to
8b0372b
Compare
camc314
reviewed
Jun 5, 2026
8b0372b to
a7c0320
Compare
a7c0320 to
16947f0
Compare
16947f0 to
af1e189
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Inside an internal
namespace N {}/module N {}, statements that reference amodule are not permitted — this matches both babel and TypeScript:
import ... from "m"/import x = require("m")→ TS1147export ... from "m"/export * from "m"→ TS1194export default ...→ TS1319export = ...→ TS1063Bare
export { x }(re-export of locals, no module source) andimport x = A.B(entity alias) stay valid, as do external modules (
declare module "x" {}) wherethese forms are allowed — the check only runs for internal namespaces, so those
never reach it.
Also removes TS1147 from the coverage denylist (
NOT_SUPPORTED_ERROR_CODES), sinceoxc now detects it.
Conformance (no regressions, positive/AST stay 100% everywhere):