Skip to content

Commit ce57324

Browse files
committed
chore: add lefthook
1 parent bc604b4 commit ce57324

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

lefthook.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://biomejs.dev/zh-cn/recipes/git-hooks/
2+
pre-commit:
3+
commands:
4+
check:
5+
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc,css}"
6+
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
7+
stage_fixed: true

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"type": "module",
44
"version": "1.0.0",
55
"scripts": {
6+
"prepare": "lefthook install",
67
"dev": "astro dev",
78
"build": "astro build && pagefind --site dist && cpr dist/pagefind public/pagefind",
89
"preview": "astro preview",
@@ -30,6 +31,7 @@
3031
"@tailwindcss/vite": "^4.1.16",
3132
"@types/lodash.kebabcase": "^4.1.9",
3233
"cpr": "^3.0.1",
34+
"lefthook": "^2.0.2",
3335
"pagefind": "^1.4.0",
3436
"tailwindcss": "^4.1.16",
3537
"vite": "^6.4.1"

pnpm-lock.yaml

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)