2026-07-22 16:37:20 +08:00
|
|
|
# Git hooks (lefthook). Keep these local checkpoints fast; CI owns the full
|
|
|
|
|
# repository-wide gate matrix.
|
2026-06-16 14:55:37 +08:00
|
|
|
# Install: `pnpm exec lefthook install` (runs automatically via postinstall).
|
2026-06-11 15:07:55 +08:00
|
|
|
|
|
|
|
|
pre-commit:
|
|
|
|
|
jobs:
|
|
|
|
|
- name: lint (staged)
|
|
|
|
|
glob: '*.{ts,mts,cts,mjs}'
|
|
|
|
|
exclude:
|
|
|
|
|
- 'vendor/*/src/**'
|
2026-07-22 16:37:20 +08:00
|
|
|
run: node_modules/.bin/eslint --fix {staged_files}
|
2026-06-11 15:07:55 +08:00
|
|
|
stage_fixed: true
|
|
|
|
|
|
2026-07-22 16:37:20 +08:00
|
|
|
- name: whitespace (staged)
|
|
|
|
|
run: git diff --cached --check
|
2026-06-11 15:07:55 +08:00
|
|
|
|
|
|
|
|
- name: vendor manifest guard
|
|
|
|
|
run: scripts/check-vendor-manifest.sh
|
|
|
|
|
|
|
|
|
|
pre-push:
|
|
|
|
|
jobs:
|
2026-07-22 16:37:20 +08:00
|
|
|
- name: typecheck
|
|
|
|
|
run: node_modules/.bin/tsc -b tsconfig.json --pretty false
|