Skip to content

fix(parser): respect optional TSNamedTupleMember for ts error 1266 &1257#18178

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

fix(parser): respect optional TSNamedTupleMember for ts error 1266 &1257#18178
graphite-app[bot] merged 1 commit intomainfrom
01-18-fix_parser_respect_optional_tsnamedtuplemember_for_ts_error_1266_1257

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Jan 18, 2026

This PR fixes TypeScript parser errors 1266 and 1257 by properly handling the optional field of TSNamedTupleMember when validating tuple element ordering constraints.

Introduced in #18146 and #18145

@github-actions github-actions bot added A-parser Area - Parser C-bug Category - Bug labels Jan 18, 2026
Copy link
Member Author

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 18, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 01-18-fix_parser_respect_optional_tsnamedtuplemember_for_ts_error_1266_1257 (2c76cdf) with main (175b73a)

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 fixes TypeScript parser errors 1266 and 1257 by properly handling the optional field of TSNamedTupleMember when validating tuple element ordering constraints.

Changes:

  • Updated tuple type parsing logic to respect the optional field on TSNamedTupleMember when checking element ordering
  • Added test case for multiple consecutive optional named tuple members
  • Updated test snapshots to reflect the new test case and corrected babel test behavior

Reviewed changes

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

Show a summary per file
File Description
crates/oxc_parser/src/ts/types.rs Extended tuple element validation to check TSNamedTupleMember.optional field alongside TSOptionalType when enforcing ordering constraints
tasks/coverage/misc/pass/ts-tuple-named-optional-member-twice.ts New test case for two consecutive optional named tuple members
tasks/coverage/snapshots/parser_misc.snap Updated to reflect new test case (62/62 tests)
tasks/coverage/snapshots/transformer_misc.snap Updated to reflect new test case (62/62 tests)
tasks/coverage/snapshots/semantic_misc.snap Updated to reflect new test case (62/62 tests)
tasks/coverage/snapshots/formatter_misc.snap Updated to reflect new test case (62/62 tests)
tasks/coverage/snapshots/codegen_misc.snap Updated to reflect new test case (62/62 tests)
tasks/coverage/snapshots/parser_babel.snap Reflects that tuple-required-after-labeled-optional test now correctly produces TS(1257) error instead of parse error

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

@Sysix Sysix marked this pull request as ready for review January 18, 2026 11:12
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 18, 2026
Copy link
Member

Boshen commented Jan 18, 2026

Merge activity

…&1257 (#18178)

> This PR fixes TypeScript parser errors 1266 and 1257 by properly handling the `optional` field of `TSNamedTupleMember` when validating tuple element ordering constraints.

Introduced in #18146 and #18145
@graphite-app graphite-app bot force-pushed the 01-18-fix_parser_respect_optional_tsnamedtuplemember_for_ts_error_1266_1257 branch from 2c76cdf to 37482eb Compare January 18, 2026 11:35
@graphite-app graphite-app bot merged commit 37482eb into main Jan 18, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-18-fix_parser_respect_optional_tsnamedtuplemember_for_ts_error_1266_1257 branch January 18, 2026 11:41
@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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants