Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Trailing Whitespace TrimmerNew to Visual Studio Code? Get it now.
Trailing Whitespace Trimmer

Trailing Whitespace Trimmer

Matteias Collet

|
275 installs
| (0) | Free
A VS Code formatter that trims trailing whitespace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Trailing Whitespace Trimmer

A formatter extension for Visual Studio Code that does nothing but trim trailing whitespace as in a lot of projects additional formatting rules are not necessary or desired.

  • VSCode Marketplace

Setup

Install the extension and add the following configuration to your VSCode's settings.json to apply it by default:

// Alternatively you can configure this via the UI:
// `Settings` -> `Editor: Default Formatter`
{
  "editor.defaultFormatter": "bitpatty.trailing-whitespace-trimmer"
}

Or to add it to specific file formats:

{
  "[plaintext]": {
    "editor.defaultFormatter": "bitpatty.trailing-whitespace-trimmer"
  }
}

Development

Update src/web/extension.ts with the necessary changes.

After building (npm run build), the project can be run locally using:

  • The VSCode debugger: local / electron
  • npm run test-web: web version

License

Published under the MIT license, see LICENSE for details.

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