Skip to content

Commit

Permalink
chore: add commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
MAXLZ1 committed Oct 27, 2022
1 parent 36f29c7 commit 736874f
Show file tree
Hide file tree
Showing 4 changed files with 652 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
35 changes: 35 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* feat:新增功能
* fix:bug 修复
* docs:文档更新
* style:不影响程序逻辑的代码修改(修改空白字符,格式缩进,补全缺失的分号等,没有改变代码逻辑)
* refactor:重构代码(既没有新增功能,也没有修复 bug)
* perf:性能, 体验优化
* test:新增测试用例或是更新现有测试
* build:主要目的是修改项目构建系统(例如 glup,webpack,rollup 的配置等)的提交
* ci:主要目的是修改项目继续集成流程(例如 Travis,Jenkins,GitLab CI,Circle等)的提交
* chore:不属于以上类型的其他类型,比如构建流程, 依赖管理
* revert:回滚某个更早之前的提交on
*/
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'build',
'fix',
'docs',
'style',
'refactor',
'perf',
'test',
'chore',
'revert',
'init',
],
]
}
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
"wujie-demo:start": "pnpm --filter \"@wujie-demo/*\" -r --stream run start",
"wujie-demo:build": "pnpm --filter \"@wujie-demo/*\" -r --stream run build",
"garfish-demo:start": "pnpm --filter \"@garfish-demo/*\" -r --stream run start",
"garfish-demo:build": "pnpm --filter \"@garfish-demo/*\" -r --stream run build"
"garfish-demo:build": "pnpm --filter \"@garfish-demo/*\" -r --stream run build",
"prepare": "husky install"
},
"author": "MAXLZ",
"license": "ISC",
"engines": {
"node": "^16 || ^18",
"pnpm": ">=7"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"husky": "^8.0.0"
}
}
Loading

0 comments on commit 736874f

Please sign in to comment.