From 81c2209a87490201b01ad278f1b1d24961f99889 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Fri, 8 Mar 2024 18:09:52 -0800 Subject: [PATCH] chore: add husky hook for commitlint --- .husky/commit-msg | 1 + package-lock.json | 16 ++++++++++++++++ package.json | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..70bd3dd --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no-install commitlint --edit "$1" diff --git a/package-lock.json b/package-lock.json index dbce720..1b85484 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@commitlint/cli": "19.0.3", "@commitlint/config-conventional": "19.0.3", "@types/jest": "29.5.12", + "husky": "9.0.11", "jest": "29.7.0", "webpack": "5.90.3" }, @@ -4755,6 +4756,21 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "dev": true, + "bin": { + "husky": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", diff --git a/package.json b/package.json index ee4e25c..ba6d5ca 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "src/index.cjs", "type": "commonjs", "scripts": { + "prepare": "husky || true", "test": "jest" }, "repository": { @@ -29,6 +30,7 @@ "@commitlint/cli": "19.0.3", "@commitlint/config-conventional": "19.0.3", "@types/jest": "29.5.12", + "husky": "9.0.11", "jest": "29.7.0", "webpack": "5.90.3" },