Open AlfieriChou opened 5 years ago
npm install --save-dev @commitlint/{config-conventional,cli}
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
{ "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } } }
<type>: <subject>
用例子来说明
rules: { 'subject-min-length': async () => [2, 'always', 5] }
该rule配置了最小subject提交长度 数组中的第一位为检查level 0为disable 1为warning 2为error 第二位是否应用 always(检查)never(不检查) 第三位为长度 默认为0
背景
安装
提交规范
commitlint配置规则
rules配置规则
用例子来说明
该rule配置了最小subject提交长度 数组中的第一位为检查level 0为disable 1为warning 2为error 第二位是否应用 always(检查)never(不检查) 第三位为长度 默认为0