Formatadores e Código
Formatador de JavaScript / TypeScript
Formatador gratuito de JavaScript e TypeScript. As regras padrão do Prettier, executadas inteiramente no navegador — deteta TypeScript automaticamente a partir de anotações de tipo. Cole, clique, copie.
Nota do editor
Understanding · JS, set to a house style.
Este capítulo aprofundado está disponível apenas em inglês no momento. A ferramenta de conversão acima funciona no seu idioma; o artigo explicativo longo ainda não foi traduzido.
Perguntas frequentes
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.
As pessoas também pesquisam por
Ferramentas relacionadas
More in this room.
- Formatador e Validador de JSONEmbeleze, minifique e valide JSON — grátis, sem registo.
- Formatador de SQLEmbeleze e indente consultas SQL feias.
- Formatador e Validador de XMLEmbeleze, minifique e valide XML — instantaneamente.
- Formatador de HTMLEmbeleze e minifique HTML — Prettier por defeito.
- Formatador de CSSEmbeleze e minifique folhas de estilo CSS.
- Formatador YAMLNormalize a indentação e estrutura YAML.