Formatowanie i Kodowanie
Formatator JavaScript / TypeScript
Darmowy formatator JavaScript i TypeScript. Domyślne zasady Prettier, działające w całości w przeglądarce – automatycznie wykrywa TypeScript na podstawie adnotacji typów. Wklej, kliknij, skopiuj.
Notka redakcyjna
Understanding · JS, set to a house style.
Ten szczegółowy rozdział jest obecnie dostępny tylko w języku angielskim. Narzędzie konwersji powyżej działa w Twoim języku; długi artykuł objaśniający nie został jeszcze przetłumaczony.
Często zadawane pytania
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.
Ludzie wyszukują również
Powiązane narzędzia
More in this room.
- Formatowanie i walidacja JSONUpiększ, minifikuj i waliduj JSON – za darmo, bez rejestracji.
- Formatator SQLUpiększ i wcięcie brzydkich zapytań SQL.
- Formatowanie i walidacja XMLUpiększ, minifikuj i waliduj XML – natychmiast.
- Formatator HTMLUpiększ i minifikuj HTML – domyślne ustawienia Prettier.
- Formatator CSSUpiększ i minifikuj arkusze stylów CSS.
- Formater YAMLNormalizuj wcięcia i strukturę YAML.