From 657daf298cedadb39c5c8d349050e318e196eaf4 Mon Sep 17 00:00:00 2001 From: Jeroen de Bruijn <62570005+jdbruijn@users.noreply.github.com> Date: Thu, 25 Feb 2021 13:43:24 +0100 Subject: [PATCH] chore: move Husky configuration to `.husky` as per v5 documentation (#101) Closes #98. --- .husky/.gitignore | 1 + .husky/commit-msg | 3 +++ .husky/pre-commit | 3 +++ package.json | 7 +------ 4 files changed, 8 insertions(+), 6 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..c9cdc63 --- /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 0000000..6e0690f --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,3 @@ +#!/bin/sh + +npx --no-install commitlint --edit "${1}" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..51e52de --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +npx --no-install lint-staged diff --git a/package.json b/package.json index b70a97a..e45afd5 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "private": true, "main": "run.js", "scripts": { + "postinstall": "husky install", "test": "NODE_PATH=./node_modules jest", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "lint": "eslint --ignore-path .gitignore ." @@ -57,11 +58,5 @@ "standard-version": "^9.1.0", "testdouble": "^3.16.1", "yaml": "^1.10.0" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } } }