From 7fe7f0096caf83765689215abe29abac383c1a7b Mon Sep 17 00:00:00 2001 From: Thomas Cooper Date: Sat, 8 Jun 2024 11:47:53 -0400 Subject: [PATCH] chore: update husky to be invoked by yarn --- .husky/commit-msg | 6 +++--- package.json | 7 ++++++- yarn.lock | 10 +++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 53b8922a..25bd3625 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" -npx --no -- commitlint --edit ${1} && npm run lint +yarn commitlint --edit "$HUSKY_GIT_PARAMS" \ No newline at end of file diff --git a/package.json b/package.json index 5403cebc..dd05b36c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,11 @@ "format": "prettier --write src/**/*.{js,jsx,ts,tsx,css,md,json,scss} test/**/*.{js,jsx,ts,tsx,json} --config ./.prettierrc", "g:tsc": "cd $INIT_CWD && tsc --build" }, + "husky": { + "hooks": { + "commit-msg": "yarn commitlint -E HUSKY_GIT_PARAMS" + } + }, "private": true, "packageManager": "yarn@4.2.2", "bin": { @@ -97,7 +102,7 @@ "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.21.5", "eslint-plugin-standard": "^5.0.0", - "husky": "^9.0.10", + "husky": "^9.0.11", "jsdom": "^24.0.0", "jsdom-global": "^3.0.2", "mocha": "^10.3.0", diff --git a/yarn.lock b/yarn.lock index 8566e243..dead9280 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,7 +897,7 @@ __metadata: express-rate-limit: "npm:^7.1.5" express-session: "npm:^1.17.1" history: "npm:5.3.0" - husky: "npm:^9.0.10" + husky: "npm:^9.0.11" jsdom: "npm:^24.0.0" jsdom-global: "npm:^3.0.2" jsonschema: "npm:^1.4.1" @@ -4915,12 +4915,12 @@ __metadata: languageName: node linkType: hard -"husky@npm:^9.0.10": - version: 9.0.10 - resolution: "husky@npm:9.0.10" +"husky@npm:^9.0.11": + version: 9.0.11 + resolution: "husky@npm:9.0.11" bin: husky: bin.mjs - checksum: 10c0/585d95fec151d2e3fba1a8d97c1290dee40b83eb2b8850afae0805e183b3b3ec45bfeef97b2d0c4ae16f1c1bf19788b9129627d9ba02d924c874632207e33b93 + checksum: 10c0/2c787dcf74a837fc9a4fea7da907509d4bd9a289f4ea10ecc9d86279e4d4542b0f5f6443a619bccae19e265f2677172cc2b86aae5c932a35a330cc227d914605 languageName: node linkType: hard