Files
oxc-project__oxc/tasks/coverage/misc/fail/missing-conditional-alternative.js
sapphi-red 2ef8f01624 feat(parser): improve error message for missing conditional alternative (#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.
2025-11-04 13:12:59 +00:00

2 lines
18 B
JavaScript