prettier-plugin-ember-hbs-tag weekly downloads statistics
By ijlee2 · npm · Prettier plugins
Prettier plugin to format hbs tags
prettier-plugin-ember-hbs-tag has 702 recorded weekly downloads on npm, a decrease of 51.1% over the past 30 days, ranking #1501 of 2,322 tracked listings.
About prettier-plugin-ember-hbs-tag
prettier-plugin-ember-hbs-tag
Prettier plugin to format hbs tags
Why use this package?
Until now, Ember developers had to use ember-template-lint-plugin-prettier to format their *.hbs files. This is a bit strange, because Prettier natively supports Handlebars since May 2021.
The plugin also comes with a few issues:
- It uglifies code inside an
hbstag (i.e. wrong indentations in rendering tests, Storybook stories). - It needs to dynamically load
prettierand use a hook fromember-template-lintto format*.hbs. Due to strong coupling, it will fall behind ifprettierorember-template-lintmakes a breaking change to their API. - Prettier recommends not running
prettierthrough a linter plugin. In January 2025, Ember CLI removedeslint-plugin-prettierandstylelint-prettierfrom its blueprints, in order to separate formatting and linting.
In short, what we're missing is a Prettier plugin to format hbs tags.
[!TIP]
Use
prettier-plugin-ember-template-tagto format<template>tags. You can find out below how to set up both plugins.
Installation
-
In
<details> <summary><code>package.json</code></summary>package.json, replaceember-template-lint-plugin-prettierwithprettier-plugin-ember-hbs-tag.eslint-plugin-prettierandstylelint-prettierare assumed to have been removed already. For more details, please see my blog post.
</details>{ "devDependencies": { "ember-template-lint": "...", - "ember-template-lint-plugin-prettier": "...", "prettier": "...", + "prettier-plugin-ember-hbs-tag": "...", "prettier-plugin-ember-template-tag": "..." } } -
Remove
<details> <summary><code>.template-lintrc.cjs</code></summary>ember-template-lint-plugin-prettierfrom theember-template-lintconfiguration.
</details>'use strict'; module.exports = { - plugins: ['ember-template-lint-plugin-prettier'], - extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'], - overrides: [ - { - files: ['**/*.{gjs,gts}'], - rules: { - prettier: 'off', - }, - }, - { - files: ['tests/**/*-test.{js,ts}'], - rules: { - prettier: 'off', - }, - }, - ], + extends: ['recommended'], }; -
Add
<details> <summary><code>prettier.config.mjs</code></summary>prettier-plugin-ember-hbs-tagto theprettierconfiguration.Prettier's default parser for
*.{js,ts}is'babel'. To format*.{js,ts}with anhbstag, set the parser to'ember-hbs-tag'.
</details>export default { plugins: [ 'prettier-plugin-ember-hbs-tag', 'prettier-plugin-ember-template-tag', ], overrides: [ { files: ['*.{cjs,cts,js,mjs,mts,ts}'], options: { singleQuote: true, }, }, { files: ['tests/**/*-test.{js,ts}'], options: { parser: 'ember-hbs-tag', singleQuote: true, templateSingleQuote: false, }, }, { files: ['*.{gjs,gts}'], options: { singleQuote: true, templateSingleQuote: false, }, }, { files: ['*.hbs'], options: { printWidth: 64, singleQuote: false, }, }, ], }; -
Finally, run
installto update your project dependencies. Runlintandlint:fixto check thathbstags can be formatted.
Plugin options
<details> <summary><code>preserveTrailingWhitespace</code></summary>By default, the plugin aims for prettiness.
If you need the trailing whitespace to remain unchanged (e.g. in tests), set preserveTrailingWhitespace to true.
/* prettier.config.mjs */
export default {
overrides: [
{
files: ['tests/**/*-test.{js,ts}'],
options: {
parser: 'ember-hbs-tag',
+ preserveTrailingWhitespace: true,
},
},
],
};
</details>
<details>
<summary><code>templateSingleQuote</code></summary>
By default, Prettier uses single quotes in *.{js,ts}, and the plugin uses the global value of singleQuote to decide whether to use single or double quotes in templates.
However, you will most likely want double quotes for templates. So set templateSingleQuote to false, just like you did it for prettier-plugin-ember-template-tag.
/* prettier.config.mjs */
export default {
overrides: [
{
files: ['tests/**/*-test.{js,ts}'],
options: {
parser: 'ember-hbs-tag',
+ templateSingleQuote: false,
},
},
],
};
</details>
Compatibility
- Prettier v3
- Node.js v22 or above
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.
Description from the npm listing.
- ember
- emberjs
- prettier
- prettier-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Prettier plugins plugins
All 20 prettier-plugin-ember-hbs-tag alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-ember-hbs-tag. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.