Skip to content

Commit 9058be9

Browse files
onairmarcEncoreBot
andauthored
Update Prettier Handling (#4)
Co-authored-by: EncoreBot <ghbot@encoredigitalgroup.com>
1 parent d00d443 commit 9058be9

File tree

3 files changed

+14
-31
lines changed

3 files changed

+14
-31
lines changed

.prettierignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.prettierrc.cjs

Lines changed: 0 additions & 17 deletions
This file was deleted.

bin/cli.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ const options = {
1616
dryRun: false,
1717
};
1818

19+
const prettierConfig = {
20+
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
21+
bracketSpacing: false,
22+
trailingComma: "all",
23+
arrowParens: "avoid",
24+
tabWidth: 4,
25+
editorconfig: true,
26+
useTabs: false,
27+
printWidth: 120,
28+
importOrderSeparation: true,
29+
singleQuote: false,
30+
semi: true,
31+
};
32+
1933
let targetDir = process.cwd();
2034

2135
for (let i = 0; i < args.length; i++) {
@@ -34,12 +48,6 @@ for (let i = 0; i < args.length; i++) {
3448
async function runPrettier(targetDir, dryRun) {
3549
try {
3650
// Get Prettier config from this package
37-
const configPath = path.resolve(__dirname, "..", ".prettierrc.cjs");
38-
let prettierConfig = {};
39-
40-
if (fs.existsSync(configPath)) {
41-
prettierConfig = require(configPath);
42-
}
4351

4452
const files = glob.sync("**/*.{js,ts,jsx,tsx}", {
4553
cwd: targetDir,

0 commit comments

Comments
 (0)