Skip to content

Commit a1b286d

Browse files
committed
chore: add local lefthook guard auto-installed via prepare
Replace the empty lefthook.yml with real pre-commit (typecheck) and pre-push (typecheck, test) hooks mirroring ci.yml, and add a prepare script so npm install auto-installs them. Local guard before push, ci.yml still gates merges.
1 parent bc86ad1 commit a1b286d

3 files changed

Lines changed: 183 additions & 1 deletion

File tree

lefthook.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Local CI guard. Mirrors .github/workflows/ci.yml so broken code never reaches a push.
2+
# Auto-installed via the package.json prepare script on npm install.
3+
pre-commit:
4+
parallel: true
5+
commands:
6+
typecheck:
7+
run: npx tsc --noEmit
8+
pre-push:
9+
parallel: false
10+
commands:
11+
typecheck:
12+
run: npx tsc --noEmit
13+
priority: 1
14+
test:
15+
run: npm test
16+
priority: 2

package-lock.json

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

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"ios": "expo start --ios",
99
"web": "expo start --web",
1010
"typecheck": "tsc --noEmit",
11-
"test": "jest"
11+
"test": "jest",
12+
"prepare": "lefthook install"
1213
},
1314
"jest": {
1415
"preset": "jest-expo/node"
@@ -42,6 +43,7 @@
4243
"babel-preset-expo": "~56.0.0",
4344
"jest": "~29.7.0",
4445
"jest-expo": "~56.0.5",
46+
"lefthook": "^2.1.9",
4547
"typescript": "~6.0.3"
4648
},
4749
"private": true

0 commit comments

Comments
 (0)