biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.21k stars 474 forks source link

BREAKING: don't parse JSX in `.js` and `.ts` files #4385

Open ematipico opened 1 week ago

arendjr commented 1 week ago

For .ts I understand, since the TypeScript compiler makes the same distinction, but why would we do this for .js files? There are plenty of codebases that use .js files with JSX content and it's an accepted practice.

ematipico commented 1 week ago

It's an old and debatable practice. Nowadays, new projects always use .tsx and .jsx straightaway. New and modern projects should rely on file extensions and prior config, see .mjs and .cjs and pakcage.json#type, for example.

We intend to provide an option to opt in to the old behaviour (there's already a task for that in the checklist).