-
-
Notifications
You must be signed in to change notification settings - Fork 722
feat(parser): add more help messages to diagnostics #15440
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
feat(parser): add more help messages to diagnostics #15440
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 #15440 will not alter performanceComparing Summary
Footnotes |
27731bd to
6181bb5
Compare
6181bb5 to
b5dc76a
Compare
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 enhances error messages in the TypeScript parser by adding helpful context to diagnostic messages. The changes improve user experience by providing actionable guidance when errors occur.
Key changes:
- Added help text to TypeScript constructor and arrow function parameter errors
- Capitalized help message for
superusage errors for consistency - Enhanced JSX closing tag mismatch errors with clearer labels showing which tag was opened and what closing tag is expected
- Added explanatory help messages for private identifiers with accessibility modifiers and import equals statements
Reviewed Changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/diagnostics.rs | Added help messages and improved error formatting for TS constructor type parameters, arrow function this parameters, super usage, JSX tag mismatches, private identifiers, and import equals statements |
| tasks/transform_conformance/snapshots/babel.snap.md | Updated snapshots to reflect new help messages for private identifiers |
| tasks/coverage/snapshots/parser_typescript.snap | Updated snapshots with all new help messages including super, constructor type parameters, JSX improvements, and import equals |
| tasks/coverage/snapshots/parser_test262.snap | Updated snapshot for capitalized super help message |
| tasks/coverage/snapshots/parser_misc.snap | Updated snapshots for improved JSX closing tag error messages |
| tasks/coverage/snapshots/parser_babel.snap | Updated snapshots for capitalized super help message and new help messages for private identifiers and constructor type parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Added more helps to parser errors to make it easier to understand why the error happens or how it can be resolved.
b5dc76a to
b7e3849
Compare

Added more helps to parser errors to make it easier to understand why the error happens or how it can be resolved.