From dfad8b40c1fa003ab9f101e1b015f307322731df Mon Sep 17 00:00:00 2001 From: Philipp Hinrichsen Date: Wed, 19 Jan 2022 14:16:53 +0100 Subject: [PATCH] chore: migrate husky to v7 --- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ package.json | 9 ++------- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 000000000..9b58085f5 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx commitlint -e $HUSKY_GIT_PARAMS 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 efaea4838..2f3202130 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,8 @@ "release:rollback": "yarn is-release-bot-commit && git reset --hard HEAD^", "release:create-nightly": "yarn release premajor --conventional-prerelease --preid nightly", "release:rc": "yarn release --conventional-prerelease --preid rc", - "release:graduate": "yarn release --conventional-graduate" + "release:graduate": "yarn release --conventional-graduate", + "prepare": "husky install" }, "canarist": { "projects": [ @@ -67,12 +68,6 @@ } ] }, - "husky": { - "hooks": { - "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.{js,json,css}": [ "prettier --list-different"