fix(parser): improve diagnostics around modifier checks#13526
Merged
Boshen merged 4 commits intooxc-project:mainfrom Sep 9, 2025
Merged
fix(parser): improve diagnostics around modifier checks#13526Boshen merged 4 commits intooxc-project:mainfrom
Boshen merged 4 commits intooxc-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request improves TypeScript parser diagnostics around modifier validation, addressing five specific cases from issue #11713. The changes focus on providing more accurate error messages for invalid modifier usage and fixing redundant diagnostic reporting.
- Enhanced modifier validation for method signatures, index signatures, and class elements
- Added new TS(1024) diagnostic for modifiers that can only appear on property declarations or index signatures
- Generalized the TS(1029) diagnostic to handle various modifier ordering issues beyond just export/declare
Reviewed Changes
Copilot reviewed 5 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/ts/types.rs | Added readonly modifier validation for method signatures and removed redundant index signature validation |
| crates/oxc_parser/src/ts/statement.rs | Moved index signature modifier validation earlier to avoid redundant error reporting |
| crates/oxc_parser/src/modifiers.rs | Generalized export/declare modifier ordering diagnostic |
| crates/oxc_parser/src/js/class.rs | Enhanced modifier validation for class index signatures and method declarations |
| crates/oxc_parser/src/diagnostics.rs | Added new TS(1024) diagnostic and generalized TS(1029) for modifier ordering |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13526 will not alter performanceComparing Summary
|
Member
|
Thank you for the nice work! |
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.
Follow up to #13368.
Closes #11713 by fixing five more cases mentioned in #11713 (comment).
Other changes: