Skip to content

feat(parser): improve error message for missing conditional alternative#15268

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-03-feat_parser_improve_error_message_for_missing_conditional_alternative
Nov 4, 2025
Merged

feat(parser): improve error message for missing conditional alternative#15268
graphite-app[bot] merged 1 commit intomainfrom
11-03-feat_parser_improve_error_message_for_missing_conditional_alternative

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Nov 4, 2025

Improve error message for missing alternative for conditional expressions.

 × Expected `:` but found `EOF`
   ╭─[misc/fail/missing-conditional-alternative-type.ts:2:1]
 1 │ type A = 1 extends 2 ? 3
   ·                      ┬
   ·                      ╰── Conditional starts here
   ╰────

  × Expected `:` but found `EOF`
   ╭─[misc/fail/missing-conditional-alternative.js:2:1]
 1 │ const foo = 1 ? 2
   ·               ┬
   ·               ╰── Conditional starts here
   ╰────

Without this PR, the error mesage is a simple Expected `:` but found `EOF` only.

@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Nov 4, 2025
Copy link
Member Author

sapphi-red commented Nov 4, 2025


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 Nov 4, 2025

CodSpeed Performance Report

Merging #15268 will not alter performance

Comparing 11-03-feat_parser_improve_error_message_for_missing_conditional_alternative (d28a78e) with 11-03-feat_parser_improve_trailing_comma_error_messages (e0dba36)

Summary

✅ 37 untouched

@sapphi-red sapphi-red force-pushed the 11-03-feat_parser_improve_trailing_comma_error_messages branch from dedfa97 to e0dba36 Compare November 4, 2025 12:18
@sapphi-red sapphi-red force-pushed the 11-03-feat_parser_improve_error_message_for_missing_conditional_alternative branch from 95550fb to d28a78e Compare November 4, 2025 12:18
@sapphi-red sapphi-red marked this pull request as ready for review November 4, 2025 12:24
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 4, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 4, 2025

Merge activity

…ve (#15268)

Improve error message for missing alternative for conditional expressions.
```
 × Expected `:` but found `EOF`
   ╭─[misc/fail/missing-conditional-alternative-type.ts:2:1]
 1 │ type A = 1 extends 2 ? 3
   ·                      ┬
   ·                      ╰── Conditional starts here
   ╰────

  × Expected `:` but found `EOF`
   ╭─[misc/fail/missing-conditional-alternative.js:2:1]
 1 │ const foo = 1 ? 2
   ·               ┬
   ·               ╰── Conditional starts here
   ╰────
```
Without this PR, the error mesage is a simple ``Expected `:` but found `EOF` `` only.
@graphite-app graphite-app bot force-pushed the 11-03-feat_parser_improve_trailing_comma_error_messages branch from e0dba36 to 5f203c6 Compare November 4, 2025 13:13
@graphite-app graphite-app bot force-pushed the 11-03-feat_parser_improve_error_message_for_missing_conditional_alternative branch from d28a78e to 2ef8f01 Compare November 4, 2025 13:13
Base automatically changed from 11-03-feat_parser_improve_trailing_comma_error_messages to main November 4, 2025 13:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 4, 2025
@graphite-app graphite-app bot merged commit 2ef8f01 into main Nov 4, 2025
22 checks passed
@graphite-app graphite-app bot deleted the 11-03-feat_parser_improve_error_message_for_missing_conditional_alternative branch November 4, 2025 13:18
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

Comments