-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathlefthook.yml
42 lines (40 loc) · 1.09 KB
/
lefthook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# yaml-language-server:$schema=./node_modules/lefthook/schema.json
# https://evilmartians.github.io/lefthook/configuration/
pre-commit:
piped: true
follow: true
commands:
staged:
priority: 1
run: echo {staged_files}
security:
priority: 2
run: gitleaks protect --staged --no-banner
# typescript:
# priority: 3
# glob: "*.{ts,tsx}"
# run: na tsc
biome:
priority: 4
glob: "*.{ts,tsx,js,jsx,json,jsonc,css}"
run: na biome check --fix {staged_files} --reporter summary
stage_fixed: true
# test:
# priority: 5
# glob: "*.{ts,tsx,js,jsx}"
# run: na jest --findRelatedTests {staged_files}
prettier: # Biome 尚不支持 markdown 文件
priority: 6
glob: "*.{md,mdx,html,htm,yaml,yml,scss}"
run: na prettier --write {staged_files}
stylelint: # Biome 尚不支持 scss 文件
priority: 7
glob: "*.{scss}"
run: na stylelint --fix {staged_files}
prepare-commit-msg:
commands:
commit:
interactive: true
run: na git-cz --hook
env:
LEFTHOOK: "0"