Skip to content

Commit

Permalink
Merge pull request #83 from embroider-build/add-prettier-config
Browse files Browse the repository at this point in the history
Add prettier config (with `<template>` support
  • Loading branch information
NullVoxPopuli authored Sep 26, 2024
2 parents a2df465 + 174a977 commit 1743eb5
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
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',
},
},
],
};
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = {
// Needed for eslint
'globals',
'babel-plugin-ember-template-compilation',
'prettier-plugin-ember-template-tag',
],
packageManager: options.packageManager,
});
Expand All @@ -105,6 +106,8 @@ module.exports = {
'.eslintrc.js',
// This file is not supported in ESLint 9
'.eslintignore',
// replaced with .prettierrc.cjs
'.prettierrc.js',
];

for (let file of filesToDelete) {
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 1743eb5

Please sign in to comment.