From 1099f5ea93ee431948c3a4a64e7e73ff89a55318 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Fri, 30 Sep 2022 18:01:56 +0200 Subject: [PATCH] chore(): fix husky script --- .husky/.gitignore | 1 + .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ package.json | 13 +++---------- 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit 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..314e8214 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install 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..c70c608e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install 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",