Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>TypeScript Formatter AgentNew to Visual Studio Code? Get it now.
TypeScript Formatter Agent

TypeScript Formatter Agent

sonawane-yogesh

| (0) | Free
A formatter agent that enforces single-line functions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TypeScript Formatter Agent

A GitHub Copilot Chat participant (@formatter) that reformats TypeScript code: it collapses function signatures and calls onto a single line while keeping function bodies multi-line, adds missing semicolons, and strips blank lines — without touching comments, strings, or template literals.

Features

  • Collapses function signatures to a single line, keeping the body multi-line
  • Collapses function calls to a single line
  • Adds missing semicolons to statement ends
  • Removes blank/empty lines
  • Preserves comments, template literals, and string contents untouched

Before:

function add(
  a: number,
  b: number
): number {
  return a + b;
}

After:

function add(a: number, b: number): number {
  return a + b;
}

Usage

  1. Select the TypeScript code you want to format in the editor
  2. Open GitHub Copilot Chat (Ctrl+Alt+I)
  3. Type @formatter format this
  4. The formatted code is applied to your selection automatically (press Ctrl+Z to undo)

You can also invoke @formatter without a selection to have it format a code snippet pasted directly into the chat.

Requirements

  • GitHub Copilot installed and signed in, with an active Copilot subscription (the agent sends your code to a Copilot language model to perform the formatting)
  • VS Code 1.108.1 or higher

Known limitations

  • Formatting quality depends on the underlying Copilot language model and is not guaranteed to be 100% deterministic
  • Only TypeScript formatting rules are targeted; other languages are not supported

Release Notes

See CHANGELOG.md for details.

Contributing / Issues

Found a bug or have a feature request? Please open an issue on the GitHub repository.

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft