diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..36af21989 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 929f6a64a..2f1c59390 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "setup": "npm run clean && npm install", "setup:yarn": "yarn run clean && yarn", "setup:pnpm": "pnpm run clean && pnpm install", - "postinstall": "ts-patch install && nx run core:setup", + "postinstall": "ts-patch install && husky install && nx run core:setup", "start": "nps", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s" }, @@ -44,9 +44,9 @@ "eslint-config-prettier": "~6.11.0", "eslint-plugin-prettier": "^3.3.1", "gonzales": "^1.0.7", - "husky": "^4.2.5", + "husky": "^5.1.3", "jest": "~26.2.2", - "lint-staged": "^10.2.11", + "lint-staged": "^10.5.0", "mocha": "^8.0.1", "mocha-typescript": "^1.1.17", "module-alias": "^2.2.2", @@ -67,11 +67,6 @@ "webpack": "~4.44.1", "webpack-cli": "~3.3.12" }, - "husky": { - "hooks": { - "pre-commit": "npx lint-staged" - } - }, "lint-staged": { "**/*": [ "nx format:write --files"