-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
51 lines (44 loc) · 1.26 KB
/
Copy pathlefthook.yml
File metadata and controls
51 lines (44 loc) · 1.26 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Lefthook hooks for CoDo (Next.js + ESLint + oxfmt + tests)
# https://lefthook.dev/configuration/
# Tests: any file matching *.test.* or *.spec.* is run via `bun test`.
#
# Pre-commit formats and auto-fixes lint on staged files, then re-stages fixes.
pre-commit:
parallel: false
jobs:
- name: format (fix)
glob: "*.{js,jsx,ts,tsx,mjs,cjs,json,css,md}"
exclude:
- "components/ui/**"
- "bun.lock"
- ".next/**"
run: bunx oxfmt {staged_files}
stage_fixed: true
- name: lint (fix)
glob: "*.{js,jsx,ts,tsx,mjs,cjs}"
exclude:
- "components/ui/**"
run: bunx eslint --fix {staged_files}
stage_fixed: true
- name: test
glob: "**/*.{ts,tsx}"
exclude:
- "**/node_modules/**"
- "**/.next/**"
- "**/components/ui/**"
- "**/.agents/**"
- "**/.vscode/**"
- "**/*.tsbuildinfo"
- "next-env.d.ts"
run: bun run test
pre-push:
parallel: true
jobs:
- name: lint (all)
run: bunx eslint . --max-warnings 0
- name: typecheck
run: bunx tsc --noEmit
- name: test
run: bun run test
- name: format check
run: bunx oxfmt --check app components lib packages hooks css --no-error-on-unmatched-pattern