From 48ebe8ddb3ef12656a79072ec3069d90adaa4cdc Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Thu, 18 Mar 2021 13:00:44 -0400 Subject: [PATCH] chore: update Husky configuration for V5 --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 8 ++------ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .husky/.gitignore 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/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 5d78508..4896bf4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint": "npm-run-all lint:**", "lint:js": "eslint .", "lint:other": "prettier --check '**/*.{json,md,yml}'", - "test": "yarn workspaces run test" + "test": "yarn workspaces run test", + "prepare": "husky install" }, "devDependencies": { "eslint": "^7.13.0", @@ -27,11 +28,6 @@ "node": "12.19.1", "yarn": "1.22.10" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.js": "eslint --fix", "*.{json,md,yml}": "prettier --write"