From cf4e8610ed809a2d9987d8cbdc5912fda64d45ca Mon Sep 17 00:00:00 2001 From: MiJiaCoding <1137551712@qq.com> Date: Thu, 29 Jun 2023 20:44:44 +0800 Subject: [PATCH] ci: add commitlint --- .husky/commit-msg | 4 ++++ commitlint.config.js | 1 + package.json | 8 +++++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 .husky/commit-msg create mode 100644 commitlint.config.js diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..c160a77 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx --no -- commitlint --edit ${1} diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..28fe5c5 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = {extends: ['@commitlint/config-conventional']} diff --git a/package.json b/package.json index e980cab..12827d7 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,14 @@ "test": "vitest" }, "devDependencies": { - "@types/node": "^20.3.1", - "@types/prettier": "^2.7.3", + "@commitlint/cli": "^17.6.6", + "@commitlint/config-conventional": "^17.6.6", "@doctors/core": "workspace:*", - "@doctors/utils": "workspace:*", "@doctors/npm-pkg": "workspace:*", + "@doctors/utils": "workspace:*", "@doctors/web-tools": "workspace:*", + "@types/node": "^20.3.1", + "@types/prettier": "^2.7.3", "bumpp": "^9.1.1", "father": "^4.1.8", "husky": "^8.0.3",