diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..c9cdc63b --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..4561e286 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no commitlint --edit $1 \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..64e09aba --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 606f4b8b..5abcc605 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "prepublish:npm": "npm run build", "publish:npm": "npm publish --access public", "prerelease": "npm run build", - "release": "release-it" + "release": "release-it", + "prepare": "husky install" }, "peerDependencies": { "@nestjs/common": "^8.0.0 || ^9.0.0" @@ -47,15 +48,7 @@ "jsonwebtoken": "8.5.1" }, "lint-staged": { - "*.ts": [ - "prettier --write" - ] - }, - "husky": { - "hooks": { - "commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } + "**/*.{ts,json}": [] }, "repository": { "type": "git",