About TypeScript Formatter
Tidy up TypeScript snippets from reviews, docs or chat without opening an editor. The formatter understands type annotations, interfaces, generics, enums and decorators, and lays them out in Prettier’s familiar style.
It formats code; it does not type-check it. Syntax errors are reported with their position, but type errors are left for your compiler.
How to use it
- Paste TypeScript into the Input panel, or Open a .ts or .tsx file.
- Pick an indent of 2, 4 or Tab.
- Check the Problems panel for syntax errors.
- Copy the formatted code or Download it.
Frequently asked questions
Does it report type errors?
No. Only syntax errors are reported. Use the TypeScript compiler to check types.
Does it support TSX?
Yes. Code with JSX inside TypeScript is supported.
Is the code kept private?
Yes. Formatting runs in your browser and nothing is uploaded.