TypeScript Formatter

Format TypeScript without setting up a project — interfaces, generics, enums and decorators included.

Input · drop a file

Output

Formatting, not type-checking

Prettier’s TypeScript parser understands the syntax well enough to lay it out, but it does not type-check. Code with a type error formats fine; code with a syntax error (a missing brace) is reported with its line.

Questions

Does it read my .prettierrc?

No — choose indentation, quotes and semicolons with the options above the editor.

Does TSX (React) work?

Yes.

Related tools