A Prettier plugin for formatting Ember template tags in .gjs and .gts files, currently at version 2.1.5. It requires Prettier >= 3.0.0 and Node 18+ or 20+. The plugin integrates Prettier's babel-ts parser for the script portion and the glimmer parser for template content, providing seamless formatting for Ember's first-class component templates. Unlike alternative approaches (e.g., using eslint-plugin-ember), this plugin is the recommended official solution for formatting GJS/GTS files. Releases follow a patch/minor cadence with active maintenance from the Ember Tooling team. Notable recent changes include dual CJS/ESM output since v2.1.0, and fix for comment formatting crash in v2.1.4.
npm install prettier-plugin-ember-template-tagVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Prettier with the plugin for .gjs/.gts files, including overrides for single quotes and trailing commas.
Upgrade to Prettier 3+.
Ensure Prettier version is >=3.0.0. Update configuration as needed.
If using eslint-plugin-ember <12, downgrade plugin to 1.1.0. Otherwise upgrade eslint-plugin-ember to >=12.
Use prettier >=3.1 and the plugins array in config, or add --plugin flag to command.
Remove the prettier section from package.json or ensure consistency between both config sources.
Use separate handlebars prettier plugin for .hbs files.
Install plugin: npm install --save-dev prettier-plugin-ember-template-tag. Use string name in plugins array, not a path.
Check if plugin is installed. Ensure prettier >= 3.0.0.
Upgrade to Prettier 3+ or downgrade plugin to v1.x.
Add 'prettier-plugin-ember-template-tag' to the plugins array in config or use --plugin flag.