From c0d443447953cfded354d27964c6ac2be7227405 Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:57:28 +0000 Subject: [PATCH] chore(husky): fix husky hooks --- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ package.json | 7 +------ 3 files changed, 9 insertions(+), 6 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 00000000..e8511eae --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..d37daa07 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install lint-staged diff --git a/package.json b/package.json index 53963d3e..1f533761 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", + "prepare": "husky install", "lint": "npm run eslint:check && npm run prettier:check", "eslint:check": "eslint src/ test/ examples/ *.js", "eslint:fix": "eslint --fix src/ test/ examples/ *.js", @@ -112,12 +113,6 @@ "type": "git", "url": "https://github.com/uuidjs/uuid.git" }, - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.{js,jsx,json,md}": [ "prettier --write"