-
-
Notifications
You must be signed in to change notification settings - Fork 724
feat(semantic): add TS2309 error for export assignment with other exports #15992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(semantic): add TS2309 error for export assignment with other exports #15992
Conversation
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. |
CodSpeed Performance ReportMerging #15992 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this 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.
Boshen
left a comment
There was a problem hiding this 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.
Merge activity
|
3748cbb to
f317b33
Compare

Added TS2309 error check.