diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000000..0bd658f4962 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-comit b/.husky/pre-comit new file mode 100755 index 00000000000..a8c5b070978 --- /dev/null +++ b/.husky/pre-comit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run eslint diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000000..62434f4dcb2 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run tsc && npm run eslint && npm run doc && npm run ensure-pinned-deps diff --git a/package.json b/package.json index 894f17e3588..09b825b4c82 100644 --- a/package.json +++ b/package.json @@ -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" - } } }