Skip to content

Commit 96aff36

Browse files
committed
chore: add lefthook to automate linting/formatting
1 parent f1dd440 commit 96aff36

File tree

5 files changed

+121
-11
lines changed

5 files changed

+121
-11
lines changed

.husky/pre-commit

Lines changed: 0 additions & 7 deletions
This file was deleted.

.husky/pre-push

Lines changed: 0 additions & 4 deletions
This file was deleted.

lefthook.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
pre-commit:
2+
parallel: true
3+
jobs:
4+
- name: Lint files
5+
exclude:
6+
- '*.json'
7+
- '*.yaml'
8+
- '*.yml'
9+
run: pnpm lint --fix {staged_files}
10+
stage_fixed: true
11+
- name: Format files
12+
glob:
13+
- '*.json'
14+
- '**/*.json'
15+
run: pnpm prettier --write {staged_files}

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"eslint-config-unjs": "^0.5.0",
6262
"eslint-plugin-prettier": "^5.5.4",
6363
"eslint-plugin-sort": "^4.0.0",
64+
"lefthook": "^1.12.4",
6465
"memfs": "^4.39.0",
6566
"mock-fs": "^5.5.0",
6667
"prettier": "^3.6.2",
@@ -69,6 +70,11 @@
6970
"vitest": "^3.2.4"
7071
},
7172
"packageManager": "pnpm@10.15.1",
73+
"pnpm": {
74+
"onlyBuiltDependencies": [
75+
"lefthook"
76+
]
77+
},
7278
"dependencies": {
7379
"@beeman/repokit": "0.0.0-canary-20250801172233",
7480
"@clack/prompts": "0.7.0",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)