TypeScript Formatter beautifies TypeScript and TSX with consistent indentation, spacing, line wrapping, semicolons, quotes, and trailing commas. It understands interfaces, type aliases, generics, enums, decorators, modern JavaScript syntax, and React components.
Choose the standard TypeScript parser or Babel TypeScript parser, select tabs or a fixed number of spaces, and set a predictable print width. Syntax errors are reported separately instead of being mixed into the formatted output.
Formatting runs in your browser, so source code is not uploaded to a server. Press Ctrl+Enter or Command+Enter to format, then copy or save the result.