fix: setup husky properly (#7727)

This change addresses breaking changes that happened in husky which, as a result, didn't run properly since the update.
Closes #7726
This commit is contained in:
Jan Scheffler 2021-10-27 23:12:10 +02:00 committed by GitHub
parent 5b792de7a9
commit 8b712e7b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

4
.husky/commit-msg Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit "$1"

4
.husky/pre-comit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run eslint

4
.husky/pre-push Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run tsc && npm run eslint && npm run doc && npm run ensure-pinned-deps

View File

@ -17,7 +17,7 @@
"assert-unit-coverage": "cross-env COVERAGE=1 mocha --config mocha-config/coverage-tests.js",
"funit": "cross-env PUPPETEER_PRODUCT=firefox npm run unit",
"test": "npm run tsc && npm run lint --silent && npm run unit-with-coverage && npm run test-browser",
"prepare": "node typescript-if-required.js",
"prepare": "node typescript-if-required.js && husky install",
"prepublishOnly": "npm run build",
"dev-install": "npm run tsc && node install.js",
"install": "node install.js",
@ -113,12 +113,5 @@
"text-diff": "1.0.1",
"ts-node": "10.3.0",
"typescript": "4.4.4"
},
"husky": {
"hooks": {
"pre-commit": "npm run eslint",
"commit-msg": "commitlint --env HUSKY_GIT_PARAMS",
"pre-push": "npm run tsc && npm run eslint && npm run doc && npm run ensure-pinned-deps"
}
}
}