Skip to content

Commit f62ecfb

Browse files
committed
feat: replace lint/fmt with unified vp check and add pre-commit hooks
- Replace separate lint/fmt scripts with `vp check` / `vp check --fix` - Add husky + lint-staged for pre-commit hooks running `vp check --fix` - Upgrade vite-plus to 0.0.0-g61d318d2.20260227-0939 - Consolidate CI lint/fmt steps into single check step - Update CLAUDE.md command documentation
1 parent 679fb3b commit f62ecfb

6 files changed

Lines changed: 646 additions & 227 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,8 @@ jobs:
144144
- name: Type check
145145
run: vp run typecheck
146146

147-
- name: Format check
148-
run: vp run fmt:check
149-
150-
- name: Lint check
151-
run: vp run lint
147+
- name: Check
148+
run: vp run check
152149

153150
- name: Unit tests
154151
run: vp run test

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

CLAUDE.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ vp run test
2525
# Run tests in watch mode
2626
vp run test:watch
2727

28-
# Lint
29-
vp run lint
30-
vp run lint:fix
31-
32-
# Format
33-
vp run fmt
34-
vp run fmt:check
28+
# Check (lint + format)
29+
vp run check
30+
vp run check:fix
3531
```
3632

37-
**Important:** Always run `vp fmt` and `vp run build` before committing - the `dist/index.mjs` must be committed.
33+
**Important:** Always run `vp check --fix` and `vp run build` before committing - the `dist/index.mjs` must be committed.
3834

3935
## Architecture
4036

dist/index.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"lint": "vp lint --type-aware --type-check",
8-
"lint:fix": "vp run lint --fix",
7+
"check": "vp check",
8+
"check:fix": "vp check --fix",
99
"build": "vp pack",
1010
"typecheck": "tsc --noEmit",
1111
"test": "vp test run",
1212
"test:watch": "vp test -w",
13-
"fmt": "vp fmt",
14-
"fmt:check": "vp fmt --check"
13+
"prepare": "husky"
1514
},
1615
"dependencies": {
1716
"@actions/cache": "^4.1.0",
@@ -23,8 +22,13 @@
2322
},
2423
"devDependencies": {
2524
"@types/node": "^22.19.11",
25+
"husky": "^9.1.7",
26+
"lint-staged": "^16.2.7",
2627
"typescript": "^5.9.3",
2728
"vite-plus": "latest"
2829
},
30+
"lint-staged": {
31+
"*.ts": "vp check --fix"
32+
},
2933
"packageManager": "pnpm@10.28.0"
3034
}

0 commit comments

Comments
 (0)