Skip to content

feat(parser): add ts error 1265 for TSTupleElement#18144

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-17-feat_parser_add_ts_error_1265_for_tstupleelement_
Jan 18, 2026
Merged

feat(parser): add ts error 1265 for TSTupleElement#18144
graphite-app[bot] merged 1 commit intomainfrom
01-17-feat_parser_add_ts_error_1265_for_tstupleelement_

Conversation

@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Jan 17, 2026
Copy link
Member Author

Sysix commented Jan 17, 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.

@Sysix Sysix force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from 6080dfe to 5360a0b Compare January 17, 2026 17:35
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 17, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ (349c886) with main (8da684e)

Summary

✅ 42 untouched benchmarks
⏩ 3 skipped benchmarks1

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.

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 support for TypeScript error 1265, which detects when a rest element follows another rest element in tuple types. The implementation correctly identifies cases where two array-type rest elements appear consecutively in a tuple definition (e.g., [...string[], ...boolean[]]), which is invalid TypeScript syntax.

Changes:

  • Added error detection for consecutive rest elements with array types in tuple types
  • Updated the parse_delimited_list function signature to accept FnMut closures instead of Fn
  • Added new diagnostic function rest_element_cannot_follow_another_rest_element for TS error 1265

Reviewed changes

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

File Description
tasks/coverage/snapshots/parser_typescript.snap Updated test coverage showing one additional negative test passing; removed the variadicTuples2.ts from expected syntax errors and added specific TS(1265) error messages
crates/oxc_parser/src/ts/types.rs Implemented logic to track and detect consecutive rest elements with array types in tuple parsing, emitting TS error 1265 when appropriate
crates/oxc_parser/src/diagnostics.rs Added rest_element_cannot_follow_another_rest_element diagnostic function and reorganized const_class_member function for better ordering
crates/oxc_parser/src/cursor.rs Changed parse_delimited_list signature from Fn to FnMut to support closures that mutate captured state

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

@Sysix Sysix force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from 5360a0b to 08c3274 Compare January 17, 2026 18:18
@Sysix Sysix force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from 08c3274 to f8f59ce Compare January 17, 2026 18:34
@Sysix Sysix marked this pull request as ready for review January 17, 2026 18:37
@Sysix Sysix force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from f8f59ce to 0f4f7da Compare January 17, 2026 20:30
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 18, 2026

Merge activity

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
@Sysix Sysix force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from 0f4f7da to 349c886 Compare January 18, 2026 10:18
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
@graphite-app graphite-app bot force-pushed the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch from 349c886 to acf1aba Compare January 18, 2026 10:26
@graphite-app graphite-app bot merged commit acf1aba into main Jan 18, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-17-feat_parser_add_ts_error_1265_for_tstupleelement_ branch January 18, 2026 10:32
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
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