Skip to content

Commit ed5e698

Browse files
committed
fix precommit scripts
1 parent 969d048 commit ed5e698

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lefthook.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ pre-commit:
22
parallel: true
33
commands:
44
check:
5-
glob: "*.{js,ts,jsx,tsx,html,svelte,css,md,mdx,astro}"
6-
run: bun fix:staged {staged_files}
5+
glob: "*.{js,json,ts,jsx,tsx,html,svelte,css,md,mdx,astro}"
6+
run: bun check:only
7+
fix:
8+
glob: "*.{js,json,ts,jsx,tsx,html,svelte,css,md,mdx,astro}"
9+
run: bun format:staged {staged_files}
710
stage_fixed: true
811
sync:
912
run: bun sync

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"prepare": "lefthook install && bun sync",
1414
"sync": "astro sync",
1515
"dev": "astro dev",
16-
"check": "biome check . && astro check && bun prettier --check .",
17-
"fix": "biome check . --fix --unsafe && bun prettier . --write",
18-
"fix:staged": "biome check . --fix && astro check && bun prettier --write",
16+
"check": "bun check:only && bun format:check",
17+
"check:only": "astro check",
18+
"format": "biome check . --fix --unsafe && bun prettier . --write",
19+
"format:check": "biome check . && bun prettier --check .",
20+
"format:staged": "biome check . --fix && bun prettier --write",
1921
"build": "astro build",
2022
"preview": "astro preview"
2123
},

0 commit comments

Comments
 (0)