Skip to content

fix(parser): reject invalid modifiers on import aliases - #26622

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-import-alias-modifiers
Sep 15, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-import-alias-modifiers

Conversation

@camc314

@camc314 camc314 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Oxc currently accepts and discards invalid modifiers on TypeScript import aliases. Validate them before constructing the declaration: declare import X = A.B; now reports TS1079, and abstract import X = A.B; reports TS1242.

Adds regression coverage for modifier combinations and exported, ambient, external, and type-only aliases. Valid aliases retain their existing behavior.

Copilot AI lite review requested due to automatic review settings September 14, 2026 06:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T07:44:05.917687Z abef7b6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the A-parser Area - JS/TS parsing and syntax errors, oxc_parser label Sep 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e013f3cee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_parser/src/ts/statement.rs Resolved
@codspeed

codspeed Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing codex/fix-import-alias-modifiers (5c18e90) with main (fb87ed7)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c18e900a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_parser/src/ts/statement.rs Resolved
@camc314
camc314 force-pushed the codex/fix-import-alias-modifiers branch from abef7b6 to 5c18e90 Compare September 14, 2026 07:41
@camc314 camc314 self-assigned this Sep 14, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Sep 14, 2026

camc314 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abef7b678d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_parser/src/ts/statement.rs Resolved
Comment thread crates/oxc_parser/src/ts/statement.rs Resolved
Oxc currently accepts and discards invalid modifiers on TypeScript import aliases. Validate them before constructing the declaration: `declare import X = A.B;` now reports TS1079, and `abstract import X = A.B;` reports TS1242.

Adds regression coverage for modifier combinations and exported, ambient, external, and type-only aliases. Valid aliases retain their existing behavior.
@graphite-app
graphite-app Bot force-pushed the codex/fix-import-alias-modifiers branch from 5c18e90 to 827fdbd Compare September 15, 2026 07:36
@graphite-app
graphite-app Bot merged commit 827fdbd into main Sep 15, 2026
34 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 15, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-import-alias-modifiers branch September 15, 2026 07:42
graphite-app Bot pushed a commit that referenced this pull request Sep 21, 2026
### 🚀 Features

- 1fac655 coverage: Support new TypeScript fixture layout (#26226) (camc314)

### 🐛 Bug Fixes

- cd7228f minifier: Add missing negation for boolean literal (#26847) (Armano)
- 32305e2 transformer: Skip enum reverse mappings for syntactic string initializers (#26724) (Dunqing)
- 7811f0a parser: Preserve reparsed `await` tokens (#26619) (camc314)
- 9220158 transformer: Skip recovered using loop patterns (#26722) (camc314)
- 3130405 parser: Recover await using object binding patterns (#26721) (camc314)
- 827fdbd parser: Reject invalid modifiers on import aliases (#26622) (camc314)

### ⚡ Performance

- 3f1e3aa minifier: Preallocate stmts vec size to avoid excesive reallocs (#26856) (Armano)
- bd3f69e semantic: Reuse identifier hashes in enum member lookups (#26773) (camc314)
- 5f72954 minifier: Reduce allocations when processing if statements (#26666) (Armano)
acusti pushed a commit to acusti/uikit that referenced this pull request Oct 4, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

The parser now rejects modifiers on a TypeScript `import x = …` alias,
which 0.150.0 accepted and ignored (oxc-project/oxc#26622). A
non-constant string concatenation as an enum initializer no longer gets
a numeric reverse mapping, matching Babel (oxc-project/oxc#26724);
TypeScript rejects that input (TS18033), so it isn’t pinned. The new
`reactCompiler.reportDiagnostics` option reaches oxc through the
plugin’s `compiler` option but has no visible effect, because the
plugin only reads `fatal`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U23pU27G1XC7e5SDDWgetJ
acusti pushed a commit to acusti/uikit that referenced this pull request Oct 6, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

The parser now rejects modifiers on a TypeScript `import x = …` alias,
which 0.150.0 accepted and ignored (oxc-project/oxc#26622). A
non-constant string concatenation as an enum initializer no longer gets
a numeric reverse mapping, matching Babel (oxc-project/oxc#26724);
TypeScript rejects that input (TS18033), so it isn’t pinned. The new
`reactCompiler.reportDiagnostics` option reaches oxc through the
plugin’s `compiler` option but has no visible effect, because the
plugin only reads `fatal`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U23pU27G1XC7e5SDDWgetJ
acusti pushed a commit to acusti/uikit that referenced this pull request Oct 6, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

The parser now rejects modifiers on a TypeScript `import x = …` alias,
which 0.150.0 accepted and ignored (oxc-project/oxc#26622). A
non-constant string concatenation as an enum initializer no longer gets
a numeric reverse mapping, matching Babel (oxc-project/oxc#26724);
TypeScript rejects that input (TS18033), so it isn’t pinned. The new
`reactCompiler.reportDiagnostics` option reaches oxc through the
plugin’s `compiler` option but has no visible effect, because the
plugin only reads `fatal`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U23pU27G1XC7e5SDDWgetJ
acusti pushed a commit to acusti/uikit that referenced this pull request Oct 6, 2026
Exact pin in @acusti/vite-plugin-react-compiler, plus the root and docs
devDependency ranges so bun hoists a single copy.

The parser now rejects modifiers on a TypeScript `import x = …` alias,
which 0.150.0 accepted and ignored (oxc-project/oxc#26622). A
non-constant string concatenation as an enum initializer no longer gets
a numeric reverse mapping, matching Babel (oxc-project/oxc#26724);
TypeScript rejects that input (TS18033), so it isn’t pinned. The new
`reactCompiler.reportDiagnostics` option reaches oxc through the
plugin’s `compiler` option but has no visible effect, because the
plugin only reads `fatal`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01U23pU27G1XC7e5SDDWgetJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - JS/TS parsing and syntax errors, oxc_parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants