-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
29 lines (26 loc) · 1.04 KB
/
Copy pathlefthook.yml
File metadata and controls
29 lines (26 loc) · 1.04 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
# Lefthook git hooks for the stack-template monorepo.
# Hooks install on `pnpm install` via the root `prepare` script (`lefthook install`).
# Docs: https://lefthook.dev
#
# Design goals: FAST. Everything runs on staged files only, in parallel.
pre-commit:
parallel: true
jobs:
# Lint staged source files with oxlint (NOT eslint). --fix auto-corrects,
# then stage_fixed re-stages the changes so the commit includes them.
- name: oxlint
glob: "*.{ts,tsx,js,jsx,cjs,mjs}"
run: pnpm oxlint --fix {staged_files}
stage_fixed: true
# Format staged files with oxfmt (NOT prettier). Writing the files in place
# plus stage_fixed makes formatting auto-apply to the commit.
- name: oxfmt
glob: "*.{ts,tsx,js,jsx,cjs,mjs,json,css}"
run: pnpm oxfmt {staged_files}
stage_fixed: true
commit-msg:
jobs:
# Validate the commit message against Conventional Commits via commitlint.
# {1} is the path to the commit-msg file Git passes to the hook.
- name: commitlint
run: pnpm commitlint --edit {1}