Files
oxc-project__oxc/tasks/coverage/misc/fail/jsx-like-in-js.js
sapphi-red 71c2fb05bc feat(parser): improve error message when JSX is found while not enabled (#15725)
Improved the error message when JSX syntax is found while not enabled.

The idea came from esbuild's error message ([esbuild try](https://esbuild.github.io/try/#dAAwLjI3LjAAAGV4cG9ydCBjb25zdCBmb28gPSA8Rm9vIC8+Ow)).

**Before**
```
  x Unexpected token
   ,-[:1:20]
 1 | export const foo = <Foo />;
   :                    ^
   `----
```

**After**
```
  × Unexpected JSX expression
   ╭─[misc/fail/jsx-in-js.js:1:20]
 1 │ export const foo = <Foo />;
   ·                    ───────
   ╰────
  help: JSX syntax is disabled and should be enabled via the parser options
```
2025-11-16 02:57:34 +00:00

2 lines
25 B
JavaScript