Skip to content

Commit 18176e0

Browse files
committed
Fix prettier config to avoid formatting issues with shadcn ui
1 parent 12626db commit 18176e0

File tree

19 files changed

+425
-408
lines changed

19 files changed

+425
-408
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
eslint: true
4444
eslint_args: "**/*.{mjs,ts,tsx}"
4545
prettier: true
46-
prettier_args: "--config ./.prettierrc.mjs \"**/*.{js,json,ts,tsx,css,md,html}\""
46+
prettier_args: "--config ./.prettierrc.json \"**/*.{js,json,ts,tsx,css,md,html}\""
4747

4848
test:
4949
name: 🔎 Test

.prettierrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": ["*.md", "*.mdx"],
5+
"options": {
6+
"singleQuote": true,
7+
"tabWidth": 4
8+
}
9+
},
10+
{
11+
"files": ["src/components/ui/*.tsx"],
12+
"options": {
13+
"endOfLine": "lf",
14+
"semi": false,
15+
"singleQuote": false,
16+
"tabWidth": 2,
17+
"trailingComma": "es5"
18+
}
19+
}
20+
]
21+
}

.prettierrc.mjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ registry-deploy: registry-build ## Deploy the shadcn registry (Automatically don
9494

9595
registry-gen: ## Generate the shadcn registry (ran automatically by a pre-commit hook)
9696
npm run registry:gen
97-
npx prettier --config ./.prettierrc.mjs --write "registry.json"
97+
npx prettier --config ./.prettierrc.json --write "registry.json"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"preview": "vite preview",
1212
"lint:apply": "eslint **/*.{mjs,ts,tsx} --fix",
1313
"lint:check": "eslint **/*.{mjs,ts,tsx}",
14-
"prettier:apply": "prettier --config ./.prettierrc.mjs --write --list-different \"**/*.{js,json,ts,tsx,css,md,html}\"",
15-
"prettier:check": "prettier --config ./.prettierrc.mjs --check \"**/*.{js,json,ts,tsx,css,md,html}\"",
14+
"prettier:apply": "prettier --config ./.prettierrc.json --write --list-different \"**/*.{js,json,ts,tsx,css,md,html}\"",
15+
"prettier:check": "prettier --config ./.prettierrc.json --check \"**/*.{js,json,ts,tsx,css,md,html}\"",
1616
"registry:build": "npx shadcn build",
1717
"registry:gen": "node ./scripts/generate-registry.mjs",
1818
"ghpages:deploy": "node ./scripts/ghpages-deploy.mjs",

0 commit comments

Comments
 (0)