在代码配置commitlint, 编辑~/.commitlintrc.js,添加自己的规则。
feat:新功能(feature)
fix:修补bug
hotfix:紧急修复bug
test:增加测试
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
revert:回滚
config:构建过程或辅助工具的变动
chore:其他改动
因为在提交的时候发现有以下报错:
⧗ input: feat(*):提交新功能点
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky - commit-msg hook exited with code 1 (error)
发现前端小伙伴添加了commit规范,这对于以前就不标准提交的我来说是个好事。
这个报错只要在【feat:提交新功能点】的分号后面加个空格就好了…