Skip to content

Formateurs & Code

Formateur JavaScript / TypeScript

Formateur JavaScript et TypeScript gratuit. Règles par défaut de Prettier, exécutées entièrement dans le navigateur — détecte automatiquement TypeScript à partir des annotations de type. Collez, cliquez, copiez.

Runs in your browser
JavaScript / TypeScript formatter & validator
lines: 0chars: 0size: 0 B
JavaScript / TypeScript · UTF-8 · 2-space indent

Note de la rédaction

Understanding · JS, set to a house style.

Ce chapitre approfondi n'est actuellement disponible qu'en anglais. L'outil de conversion ci-dessus fonctionne dans votre langue ; le long article explicatif n'a pas encore été traduit.

Questions fréquentes

Quick answers.

Does it handle TypeScript?

Yes — the tool auto-detects TypeScript from type annotations (`: string`, `interface Foo`, `type X = ...`) and routes to Prettier's TS parser. You don't have to toggle anything.

Which Prettier options does it use?

Prettier's out-of-box defaults: 2-space indent, semicolons, double quotes, 80-column print width, trailing commas. These match the vast majority of published codebases.

Will it change my code's behaviour?

No — Prettier only reformats; it never changes semantics. The output runs identically to the input, byte-for-byte after transpilation.

Can it minify JavaScript?

No — Prettier is a formatter, not a minifier. For production minification use Terser, esbuild or SWC locally. They produce far smaller output than a whitespace collapser would.

Les internautes recherchent aussi

Outils similaires

More in this room.

Tout voir dans Formateurs & Code