Skip to content

Commit

Permalink
Add prettier config (with <template> support
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Sep 25, 2024
1 parent e2d0c23 commit 99521b9
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
34 changes: 34 additions & 0 deletions files-override/shared/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
options: {
singleQuote: true,
trailingComma: 'es5',
},
},
{
files: ['*.json'],
options: {
singleQuote: false,
},
},
{
files: ['*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['*.gjs', '*.gts'],
options: {
singleQuote: true,
templateSingleQuote: false,
trailingComma: 'es5',
},
},
],
};
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
'vite',
'@rollup/plugin-babel',
'decorator-transforms',
'prettier-plugin-ember-template-tag',
],
packageManager: options.packageManager,
});
Expand Down Expand Up @@ -80,7 +81,11 @@ module.exports = {
},

async afterInstall(options) {
const filesToDelete = ['app/index.html'];
const filesToDelete = [
'app/index.html',
// replaced with .prettierrc.cjs
'.prettierrc.js',
];

for (let file of filesToDelete) {
await rm(join(options.target, file));
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"execa": "^9.1.0",
"globals": "^15.3.0",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.2",
"release-plan": "^0.9.0",
"strip-ansi": "^7.1.0",
"tmp-promise": "^3.0.3",
Expand Down
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 99521b9

Please sign in to comment.