Skip to content

feat(parser): add TS1048 code to diagnostic#18546

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/01-25-feat_semantic_add_ts1048_code_to_diagnostic
Jan 25, 2026
Merged

feat(parser): add TS1048 code to diagnostic#18546
graphite-app[bot] merged 1 commit intomainfrom
c/01-25-feat_semantic_add_ts1048_code_to_diagnostic

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Jan 25, 2026

Copy link
Contributor Author

camc314 commented Jan 25, 2026


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.

@camc314 camc314 marked this pull request as ready for review January 25, 2026 19:33
Copilot AI review requested due to automatic review settings January 25, 2026 19:33
@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Jan 25, 2026
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 adds the TypeScript error code TS(1048) to an existing diagnostic message about rest element initializers. The change aligns the parser's error reporting with TypeScript's official diagnostic messages.

Changes:

  • Updated the diagnostic message "A rest element cannot have an initializer" to include the TypeScript error code TS(1048)

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.

File Description
crates/oxc_parser/src/diagnostics.rs Modified a_rest_element_cannot_have_an_initializer function to use ts_error("1048", ...) instead of OxcDiagnostic::error(...)
tasks/coverage/snapshots/parser_typescript.snap Updated snapshot with TS(1048) prefix across 5 occurrences
tasks/coverage/snapshots/parser_test262.snap Updated snapshot with TS(1048) prefix across 195 occurrences
tasks/coverage/snapshots/parser_babel.snap Updated snapshot with TS(1048) prefix across 4 occurrences

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

@graphite-app graphite-app bot changed the base branch from c/01-25-feat_semantic_add_ts1054_code_to_diagnostic to graphite-base/18546 January 25, 2026 19:43
@graphite-app graphite-app bot force-pushed the graphite-base/18546 branch from ad9924c to 823a73c Compare January 25, 2026 19:49
@graphite-app graphite-app bot force-pushed the c/01-25-feat_semantic_add_ts1048_code_to_diagnostic branch from fc34c07 to f2ab95d Compare January 25, 2026 19:49
@graphite-app graphite-app bot changed the base branch from graphite-base/18546 to main January 25, 2026 19:50
@graphite-app graphite-app bot force-pushed the c/01-25-feat_semantic_add_ts1048_code_to_diagnostic branch 2 times, most recently from 0501af5 to 04bfd10 Compare January 25, 2026 19:54
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 25, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the c/01-25-feat_semantic_add_ts1048_code_to_diagnostic branch from 04bfd10 to 7489880 Compare January 25, 2026 20:05
@camc314 camc314 changed the title feat(semantic): add TS1048 code to diagnostic feat(parser): add TS1048 code to diagnostic Jan 25, 2026
@camc314 camc314 self-assigned this Jan 25, 2026
@camc314 camc314 force-pushed the c/01-25-feat_semantic_add_ts1048_code_to_diagnostic branch from 7489880 to 866b6b3 Compare January 25, 2026 20:09
@graphite-app graphite-app bot merged commit 866b6b3 into main Jan 25, 2026
22 checks passed
@graphite-app graphite-app bot deleted the c/01-25-feat_semantic_add_ts1048_code_to_diagnostic branch January 25, 2026 20:15
camc314 added a commit that referenced this pull request Jan 26, 2026
overlookmotel pushed a commit that referenced this pull request Jan 26, 2026
### 💥 BREAKING CHANGES

- 22dec6a semantic: [**BREAKING**] Remove
`Scoping::scope_build_child_ids` and all related APIs (#18362) (Dunqing)
- 30a4899 oxc: [**BREAKING**] Remove
`CompilerInterface::semantic_child_scope_ids` (#18361) (Dunqing)
- 777fc40 ast: [**BREAKING**] Add `Ident` type (#18354) (Boshen)
- af0ca46 span: [**BREAKING**] Use `ModuleKind::CommonJS` for
`SourceType::cjs()` (#18276) (sapphi-red)

### 🚀 Features

- 0a02026 semantic: Add TS1499 code to diagnostic (#18557) (camc314)
- 8b4618f parser: Add TS1500 code to diagnostic (#18547) (camc314)
- 866b6b3 parser: Add TS1048 code to diagnostic (#18546) (camc314)
- 1117c44 parser: Add TS1054 code to diagnostic (#18541) (camc314)
- e4fcdde semantic: Add TS1053 code to diagnostic (#18539) (camc314)
- bcbf396 semantic: Add TS1052 code to diagnostic (#18538) (camc314)
- 8155edf semantic: Add TS1049 code to diagnostic (#18535) (camc314)
- 51d3b3f parser: Add TS1502 code to diagnostic (#18534) (camc314)
- 00854e8 semantic: Add TS2337 error code to super call diagnostic
(#18531) (camc314)
- 993fd2b parser: Parse unambiguous await with better error messages
(#18480) (Boshen)
- 8db0e78 linter/plugins: Handle BOMs (#18376) (overlookmotel)
- 6ac09e2 linter/plugins: Support source text not being at start of
buffer (#18375) (overlookmotel)
- 2ef5647 ast: Add escape_raw parameter to template_element builders
(#18121) (Boshen)

### 🐛 Bug Fixes

- 74d0998 semantic: Update error msg for multiple `default` cases in
switch stmt (#18526) (camc314)
- c205b0d ast: Remove `ThisExpression` from `TSModuleReference` (#18489)
(Boshen)
- aed3669 parser: Parse HTML-like comments in unambiguous mode (#18442)
(Boshen)
- c4132fb parser: Validate accessor parameters in interface method
signatures (#18391) (Boshen)
- b0cd74d semantic: Allow `var` and `function` with same name in static
blocks (#18358) (Boshen)
- 6037995 semantic: Allow `new.target` in class field initializers
(#18349) (Boshen)
- 9a15c6a semantic: Do not rely on spans for node comparison in
`Function::bind` (#18296) (overlookmotel)

### ⚡ Performance

- 6b600c4 semantic: Skip parent lookup for function declarations in
`Function::bind` (#18293) (overlookmotel)
- c27ad2d semantic: Move check for function declaration out of
`is_function_part_of_if_statement` (#18292) (overlookmotel)
- 63eb89e semantic: Skip checking redeclarations for function
expressions (#18291) (overlookmotel)
- 7c12743 semantic: Skip checking unresolved exports in CommonJS files
(#18250) (overlookmotel)
- 2349031 allocator: Increase initial chunk size from 512B to 16KB
(#18234) (Boshen)

### 📚 Documentation

- 8ccd853 npm: Update package homepage URLs and add keywords (#18509)
(Boshen)
- 9b3165f napi/parser: Clarify when to use `parseAsync` vs `parseSync`
(#18486) (Boshen)
- 1b59f63 napi/parser: Correct typo in README (#18251) (overlookmotel)
- 00ff75f mangler: Fix `top_level` option in example (#18233)
(overlookmotel)
- 2ddc073 semantic: Fix typo in comment (#18238) (overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants