Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Prettier for HandlebarsNew to Visual Studio Code? Get it now.
Prettier for Handlebars

Prettier for Handlebars

Ember Tooling

|
47,327 installs
| (2) | Free
Prettier formatting for Handlebars files - Clone of handlebars-formatter
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Handlebars Formatter

This extension allow you to format handlebars files using the currently unreleased Prettier glimmer parser

Because it uses unreleased, it may break with future changes to Prettier.

Configuration

This extension should respect options declared in .prettierrc. If you wish to provide specific overrides you can do so like this

{
  "singleQuote": true,
  "overrides": [
    {
      "files": "*.hbs",
      "options": {
        "singleQuote": false
      }
    }
  ]
}

Features

Format your handlebars files with Prettier ... that's it!

Example below from a slightly complex template from Discourse

Before

before

After

after

Usage

Using Command Palette (CMD/CTRL + Shift + P)

CMD + Shift + P -> Format Document OR CMD + Shift + P -> Format Selection

Extension Settings

This extension has no user configurable options at this point

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