Skip to content

Commit 9b10fb7

Browse files
committed
add husky-precommit hooks
1 parent 8f8e483 commit 9b10fb7

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
yarn run prettier:write
2+
yarn run lint --fix

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"typecheck": "tsc --noEmit",
1515
"lint": "eslint . --ext .ts --cache",
1616
"prettier": "prettier --check src/*.ts src/**/*.ts",
17-
"prettier:write": "prettier --write src/*.ts src/**/*.ts"
17+
"prettier:write": "prettier --write src/*.ts src/**/*.ts",
18+
"prepare": "husky"
1819
},
1920
"devDependencies": {
2021
"@tsconfig/node20": "^20.1.4",
@@ -28,6 +29,7 @@
2829
"eslint-import-resolver-typescript": "^3.6.1",
2930
"eslint-plugin-import": "^2.29.1",
3031
"eslint-plugin-prettier": "^5.2.1",
32+
"husky": "^9.1.4",
3133
"prettier": "^3.3.3",
3234
"synp": "^1.9.13",
3335
"tsx": "^4.16.5",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,6 +2948,11 @@ hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2:
29482948
dependencies:
29492949
function-bind "^1.1.2"
29502950

2951+
husky@^9.1.4:
2952+
version "9.1.4"
2953+
resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.4.tgz#926fd19c18d345add5eab0a42b2b6d9a80259b34"
2954+
integrity sha512-bho94YyReb4JV7LYWRWxZ/xr6TtOTt8cMfmQ39MQYJ7f/YE268s3GdghGwi+y4zAeqewE5zYLvuhV0M0ijsDEA==
2955+
29512956
iconv-lite@^0.4.24:
29522957
version "0.4.24"
29532958
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"

0 commit comments

Comments
 (0)