-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
28 lines (27 loc) · 1.06 KB
/
Copy pathlefthook.yml
File metadata and controls
28 lines (27 loc) · 1.06 KB
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
# Hooks run the REPO'S OWN pinned tooling, never `bunx`.
#
# `bunx <tool>` resolves the tool independently of this project, so it can fetch
# a different major and then fail, or pass, for reasons that have nothing to do
# with the code being checked. That is not hypothetical here: this repo
# deliberately holds eslint at 9 and TypeScript at 6 while 10 and 7 are
# published, so `bunx eslint` and `bunx tsc` would pull exactly the majors the
# manifest pins away from. `bunx` also writes to the lockfile as a side effect.
#
# A bare `tsc --noEmit` has a second problem: it judges the current source
# against whatever build output is lying around, so it must go through the
# pinned `typecheck` script the way CI invokes it.
#
# CI already runs the package scripts, so the hooks are the only place that can
# drift away from them.
pre-commit:
parallel: true
commands:
eslint:
glob: "**/*.{ts,tsx,mjs}"
run: ./node_modules/.bin/eslint --max-warnings 0 {staged_files}
pre-push:
commands:
typecheck:
run: bun run typecheck
knip:
run: bun run knip