Skip to content

Commit 3e1942e

Browse files
committed
chore: Add Husky and lint-staged to enforce code formatting via pre-commit hooks.
1 parent 22f6666 commit 3e1942e

File tree

3 files changed

+297
-5
lines changed

3 files changed

+297
-5
lines changed

.husky/pre-commit

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

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@
1010
"lint": "biome lint src/",
1111
"lint:fix": "biome lint --write src/",
1212
"format": "biome format --write src/",
13-
"check": "biome check src/"
13+
"check": "biome check src/",
14+
"prepare": "husky"
1415
},
1516
"devDependencies": {
16-
"vite": "npm:rolldown-vite@7.2.2",
17-
"@biomejs/biome": "^1.9.4"
17+
"@biomejs/biome": "^1.9.4",
18+
"husky": "^9.1.7",
19+
"lint-staged": "^16.2.7",
20+
"vite": "npm:rolldown-vite@7.2.2"
1821
},
1922
"pnpm": {
2023
"overrides": {
2124
"vite": "npm:rolldown-vite@7.2.2"
2225
}
26+
},
27+
"lint-staged": {
28+
"*.{js,css}": [
29+
"biome check --write"
30+
]
2331
}
2432
}

0 commit comments

Comments
 (0)