From 8e3b27fb5bedb06d49b7bfe18e83c8cb4512b955 Mon Sep 17 00:00:00 2001 From: Daryl Ronningen Date: Thu, 17 Jun 2021 01:12:30 -0700 Subject: [PATCH] chore: fix husky hooks --- .husky/.gitignore | 1 + .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ package.json | 11 ++++------- 4 files changed, 13 insertions(+), 7 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 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..e10cb53 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn commitlint -E HUSKY_GIT_PARAMS diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..d2ae35e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged diff --git a/package.json b/package.json index 42375b3..8f0f6c1 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "commit": "commit", "lint": "eslint --format=pretty src/**/*.ts", "lint:save": "eslint --format=pretty --save src/**/*.ts", + "postinstall": "husky install", "release:alpha": "standard-version --prelease alpha -s", "release:beta": "standard-version --prelease beta -s", "release:full": "standard-version -s", @@ -147,14 +148,10 @@ }, "reportUnusedDisableDirectives": true }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, "lint-staged": { - "src/**/*.ts": ["yarn lint"] + "src/**/*.ts": [ + "yarn lint" + ] }, "commitlint": { "extends": [