Skip to content

Commit 81d0327

Browse files
committed
Add husky and add pre-commit hook
1 parent ea107a3 commit 81d0327

File tree

4 files changed

+228
-0
lines changed

4 files changed

+228
-0
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm pre-commit

lint-staged.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
"*.{js,mjs,cjs,ts}": ["prettier --write", "eslint --max-warnings 0 --fix"],
3+
}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"node": ">=20"
1919
},
2020
"scripts": {
21+
"prepare": "husky",
22+
"pre-commit": "lint-staged",
2123
"start": "tsx src/index.ts",
2224
"build": "ncc build src/index.ts --license LICENSE.txt --minify",
2325
"lint": "eslint --max-warnings 0 .",
@@ -42,6 +44,8 @@
4244
"@vercel/ncc": "^0.38.1",
4345
"eslint": "^8.57.0",
4446
"eslint-config-prettier": "^9.1.0",
47+
"husky": "^9.0.11",
48+
"lint-staged": "^15.2.2",
4549
"prettier": "^3.2.5",
4650
"tsx": "^4.7.1",
4751
"typescript": "^5.3.3",

0 commit comments

Comments
 (0)