'scope-empty': [2, 'never'], // scope 不可为空 'subject-case': [2, 'never', ['start-case', 'pascal-case']], // subject 不允许使用大写开头 'header-max-length': [2, 'always', 72], // 限制提交信息的长度 }, }; type-enum:指定type的枚举值 scope-empty:不允许scope为空 subjec...
✖ subject may notbeempty[subject-empty] ✖typemay notbeempty[type-empty] 五、Commitlint的高级配置 5.1 自定义规则 可以根据团队需求自定义Commitlint规则。例如,要求每条提交消息必须包含范围(scope)。 在commitlint.config.js中添加自定义规则: module.exports = { extends: ['@commitlint/config-conve...
"subject-empty": [2, "never"], "type-empty": [2, "never"], "subject-case": [0], "type-enum": [ 2, "always", [ "feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore", "revert", "wip", "workflow", "types", "release", ], ], ...
Expected Behavior Lint a comment message like "try out commitlint." Two errors are flagged: Error: You have commit messages with errors ⧗ input: try out commitlint. ✖ subject may not be empty [subject-empty] ✖ type may not be empty [type...
subject-min-length subject 最小内容长度 subject-exclamation-mark 分割符 type type-enum type 可选值 例如: [ 'feat', 'fix' ] type-case type 单词格式 type-empty type是否为空 type-max-length type最大内容长度 type-min-length type最小内容长度 ...
"type-empty": [2, "never"], "subject-empty": [2, "never"], "subject-full-stop": [0, "never"], "subject-case": [0, "never"] } } (3)将commitlint校验命令添加到commit-msg钩子中 # Add commit-msg hook npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'...
✖ subject may not be empty [subject-empty] ✖ type may not be empty [type-empty] ✖ found2problems,0warnings ⓘGethelp:https://github.com/conventional-changelog/commitlint/#what-is-commitlinthusky - commit-msg hook exitedwithcode1(error) ...
[2,'always',['feat','fix','docs','style','refactor','perf','test','chore','revert','build',],],'type-case':[0],'type-empty':[0],'scope-empty':[0],'scope-case':[0],'subject-full-stop':[0,'never'],'subject-case':[0,'never'],'header-max-length':[0,'always',72...
提交失败问题:subject may not be empty。视频中老师说到提交commitlint内容可以用ci提交。但是视频中提交部分的代码没有录入到界面里,看不到前面老师输入了什么内容(add commitlint指令前的部分,视频最后20s的内容吧)。所以跟着敲时卡在这部分。 老师能否提示一下或者补全一下。
shellnpx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}" 测试 shell## 错误示例PS C:\Users\WangYang\Documents\Project\electron-vite-vue> git commit -m "commitlint"→ No staged files match any configured task.⧗ input: commitlint✖ subject may not be empty [subject...