Formattatori e Codice
Formattatore JavaScript / TypeScript
Formattatore JavaScript e TypeScript gratuito. Regole predefinite di Prettier, eseguite interamente nel browser — rileva TypeScript automaticamente dalle annotazioni di tipo. Incolla, clicca, copia.
Nota dell'editore
Understanding · JS, set to a house style.
Questo capitolo approfondito è attualmente disponibile solo in inglese. Lo strumento di conversione qui sopra funziona nella tua lingua; il lungo articolo esplicativo non è stato ancora tradotto.
Domande frequenti
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.
Le persone cercano anche
Strumenti correlati
More in this room.
- Formattatore e Validatore JSONRendi più bello, minimizza e convalida JSON — gratuito, senza registrazione.
- Formattatore SQLRendi più belle e indentate le query SQL brutte.
- Formattatore e Validatore XMLRendi più bello, minimizza e convalida XML — istantaneamente.
- Formattatore HTMLRendi più bello e minimizza HTML — Impostazioni predefinite Prettier.
- Formattatore CSSRendi più belli e minimizza i fogli di stile CSS.
- Formattatore YAMLNormalizza l'indentazione e la struttura YAML.