From 54865fc21f8276338da05d0a3201ca99ee296f94 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Fri, 30 Sep 2022 18:09:54 +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 b0585d95..f314430f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "publish:next": "npm publish --access public --tag next", "test:e2e": "jest --config ./tests/jest-e2e.json --runInBand", "prerelease": "npm run build", - "release": "release-it" + "release": "release-it", + "prepare": "husky install" }, "dependencies": { "axios": "0.27.2" @@ -51,15 +52,7 @@ "rxjs": "^6.0.0 || ^7.0.0" }, "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",