Skip to content

Comments

feat(semantic): add TS2309 error for export assignment with other exports#15992

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports
Dec 6, 2025
Merged

feat(semantic): add TS2309 error for export assignment with other exports#15992
graphite-app[bot] merged 1 commit intomainfrom
11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Nov 23, 2025

Added TS2309 error check.

@github-actions github-actions bot added the A-semantic Area - Semantic label Nov 23, 2025
Copy link
Member Author

sapphi-red commented Nov 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 23, 2025

CodSpeed Performance Report

Merging #15992 will not alter performance

Comparing 11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports (3748cbb) with main (ef05957)

Summary

✅ 42 untouched
⏩ 3 skipped1

Footnotes

  1. 3 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.

@sapphi-red sapphi-red marked this pull request as ready for review November 23, 2025 17:08
@sapphi-red sapphi-red requested a review from Dunqing as a code owner November 23, 2025 17:08
Copilot AI review requested due to automatic review settings November 23, 2025 17:08
@sapphi-red sapphi-red requested a review from Boshen November 23, 2025 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements TypeScript error TS2309, which detects when an export = statement is used in a module that also contains other exported elements. This is a semantic error in TypeScript because export = (CommonJS-style export) is incompatible with ES6-style exports.

Key Changes:

  • Added semantic check for TS2309 that reports errors when export = coexists with other exports in the same scope
  • Improved test coverage with 15 previously failing test cases now passing (from 57.17% to 57.76%)
  • Implemented recursive checking for nested TypeScript module declarations

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_semantic/src/checker/typescript.rs Implements the core logic for detecting export assignment conflicts, including helper functions for checking statements in programs and module declarations
crates/oxc_semantic/src/checker/mod.rs Integrates the new check into the semantic analysis pipeline, calling it during Program node processing
tasks/coverage/snapshots/parser_typescript.snap Updates test snapshots showing 15 additional negative test cases now correctly reporting TS2309 errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 24, 2025
Boshen
Boshen previously requested changes Nov 24, 2025
Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

Need to resolve AI reviews.

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 24, 2025

Merge activity

  • Nov 24, 5:54 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 25, 6:32 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Nov 25, 6:32 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Nov 25, 6:32 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 25, 6:33 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Nov 25, 6:33 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Nov 25, 6:33 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 6, 8:30 AM UTC: graphite-app added this pull request to the Graphite merge queue.
  • Dec 6, 8:36 AM UTC: Merged by the Graphite merge queue.

@sapphi-red sapphi-red force-pushed the 11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports branch from 3748cbb to f317b33 Compare November 26, 2025 12:33
@sapphi-red sapphi-red requested a review from Boshen November 26, 2025 12:35
@sapphi-red sapphi-red force-pushed the 11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports branch from f317b33 to 307b964 Compare December 6, 2025 08:23
@graphite-app graphite-app bot force-pushed the 11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports branch from 307b964 to da87812 Compare December 6, 2025 08:30
@graphite-app graphite-app bot merged commit da87812 into main Dec 6, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-20-feat_parser_add_ts2309_error_for_export_assignment_with_other_exports branch December 6, 2025 08:36
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 6, 2025
overlookmotel pushed a commit that referenced this pull request Dec 8, 2025
### 💥 BREAKING CHANGES

- 083fea9 napi/parser: [**BREAKING**] Represent empty optional fields on
JS side as `null` (#16411) (overlookmotel)

### 🚀 Features

- 7a2afee parser: Add TS1174 error for classes extending multiple base
classes (#15993) (sapphi-red)
- da87812 semantic: Add TS2309 error for export assignment with other
exports (#15992) (sapphi-red)
- d6d2bcd minifier: Remove unused function calls that are marked by
`manual_pure_functions` (#16534) (sapphi-red)
- c90f053 minifier: Support `.` separated values for
`compress.treeshake.manualPureFunctions` (#16529) (sapphi-red)
- a607cc4 codegen: Preserve comments between CatchClause's param and
body (#16167) (copilot-swe-agent)
- 8c10694 semantic: Expose get_comment_at method (#16439) (camc314)
- 3981e7a ast: Add get_comment_at to lookup a comment by span (#16438)
(camc314)

### 🐛 Bug Fixes

- 699406a napi/parser: Move `ExportEntry::module_request` field to first
(#16412) (overlookmotel)
- 12bd794 napi/parser: Move `ExportEntry::module_request` field to last
(#16403) (overlookmotel)

### ⚡ Performance

- 790beeb napi/parser: Do not remove extraneous options on JS side
(#16447) (overlookmotel)

Co-authored-by: Boshen <[email protected]>
Copilot AI pushed a commit that referenced this pull request Dec 10, 2025
### 💥 BREAKING CHANGES

- 083fea9 napi/parser: [**BREAKING**] Represent empty optional fields on
JS side as `null` (#16411) (overlookmotel)

### 🚀 Features

- 7a2afee parser: Add TS1174 error for classes extending multiple base
classes (#15993) (sapphi-red)
- da87812 semantic: Add TS2309 error for export assignment with other
exports (#15992) (sapphi-red)
- d6d2bcd minifier: Remove unused function calls that are marked by
`manual_pure_functions` (#16534) (sapphi-red)
- c90f053 minifier: Support `.` separated values for
`compress.treeshake.manualPureFunctions` (#16529) (sapphi-red)
- a607cc4 codegen: Preserve comments between CatchClause's param and
body (#16167) (copilot-swe-agent)
- 8c10694 semantic: Expose get_comment_at method (#16439) (camc314)
- 3981e7a ast: Add get_comment_at to lookup a comment by span (#16438)
(camc314)

### 🐛 Bug Fixes

- 699406a napi/parser: Move `ExportEntry::module_request` field to first
(#16412) (overlookmotel)
- 12bd794 napi/parser: Move `ExportEntry::module_request` field to last
(#16403) (overlookmotel)

### ⚡ Performance

- 790beeb napi/parser: Do not remove extraneous options on JS side
(#16447) (overlookmotel)

Co-authored-by: Boshen <[email protected]>
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
### 💥 BREAKING CHANGES

- 083fea9 napi/parser: [**BREAKING**] Represent empty optional fields on
JS side as `null` (oxc-project#16411) (overlookmotel)

### 🚀 Features

- 7a2afee parser: Add TS1174 error for classes extending multiple base
classes (oxc-project#15993) (sapphi-red)
- da87812 semantic: Add TS2309 error for export assignment with other
exports (oxc-project#15992) (sapphi-red)
- d6d2bcd minifier: Remove unused function calls that are marked by
`manual_pure_functions` (oxc-project#16534) (sapphi-red)
- c90f053 minifier: Support `.` separated values for
`compress.treeshake.manualPureFunctions` (oxc-project#16529) (sapphi-red)
- a607cc4 codegen: Preserve comments between CatchClause's param and
body (oxc-project#16167) (copilot-swe-agent)
- 8c10694 semantic: Expose get_comment_at method (oxc-project#16439) (camc314)
- 3981e7a ast: Add get_comment_at to lookup a comment by span (oxc-project#16438)
(camc314)

### 🐛 Bug Fixes

- 699406a napi/parser: Move `ExportEntry::module_request` field to first
(oxc-project#16412) (overlookmotel)
- 12bd794 napi/parser: Move `ExportEntry::module_request` field to last
(oxc-project#16403) (overlookmotel)

### ⚡ Performance

- 790beeb napi/parser: Do not remove extraneous options on JS side
(oxc-project#16447) (overlookmotel)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants