Skip to content

Commit 716aeca

Browse files
committed
build: add githooks with husky
1 parent a5c1d2a commit 716aeca

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

package.json

+4-15
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,11 @@
5151
"lint": "eslint . --ext .ts --ignore-path .gitignore --fix",
5252
"postinstall": "npm run bootstrap",
5353
"prettier": "prettier --write --parser typescript '**/*.ts'",
54-
"test": "lerna run --stream test"
55-
},
56-
"husky": {
57-
"hooks": {
58-
"pre-commit": "lint-staged",
59-
"commit-msg": "ts-node scripts/verify-commit.ts"
60-
}
54+
"test": "lerna run --stream test",
55+
"prepare": "husky install"
6156
},
6257
"lint-staged": {
63-
"*.js": [
64-
"prettier --write --ignore-path .gitignore",
65-
"git add"
66-
],
67-
"*.ts": [
68-
"npm run prettier",
69-
"git add"
70-
]
58+
"*.ts": "eslint --cache --fix",
59+
"*.{js,css,md}": "prettier --write"
7160
}
7261
}

0 commit comments

Comments
 (0)