// # 提交信息规范:feat: 使用git提交新规范 // # 注意:后面有空格,类型见下表 // git commit -m "feat: 使用git提交新规范" module.exports = { // 继承的规则 extends: ['@commitlint/config-conventional'], // 定义规则类型 rules: { // type 类型定义,表示 git 提交的 type 必须在以下类型范围内 'type-enum': [ 2, 'always', // # 注意:后面有空格,类型见下表 // git commit -m "feat: 使用git提交新规范" [ 'feat', // 新功能 feature 'fix', // 修复 bug 'docs', // 文档注释 'style', // 代码格式(不影响代码运行的变动) 'refactor', // 重构(既不增加新功能,也不是修复bug) 'perf', // 优化 'test', // 增加测试 'merge', // 分支合并 'rebase', // 分支修正 'revert', // 回退 'build', // 打包 'ci', // 持续集成 'chore' // 其他 ] ], // subject 大小写不做校验 'subject-case': [0] }, prompt: { settings: {}, messages: { skip: ':skip', max: 'upper %d chars', min: '%d chars at least', emptyWarning: 'can not be empty', upperLimitWarning: 'over limit', lowerLimitWarning: 'below limit' }, questions: { type: { description: '选择一种提交类型:', enum: { feat: { description: '新功能', title: 'Features', emoji: '✨' }, fix: { description: '修bug', title: 'Bug Fixes', emoji: '🐛' }, docs: { description: '文档注释', title: 'Documentation', emoji: '📚' }, style: { description: '代码格式(不影响代码运行)', title: 'Styles', emoji: '💎' }, refactor: { description: '重构', title: 'Code Refactoring', emoji: '📦' }, perf: { description: '调优', title: 'Performance Improvements', emoji: '🚀' }, test: { description: '增加测试', title: 'Tests', emoji: '🚨' }, merge: { description: '合并分支', title: 'Merge', emoji: '🗑' }, rebase: { description: '合并修正', title: 'Rebase', emoji: '🗑' }, revert: { description: '分支修正', title: 'Reverts', emoji: '🗑' }, build: { description: '打包相关', title: 'Builds', emoji: '🛠' }, ci: { description: '持续集成脚本相关', title: 'Continuous Integrations', emoji: '⚙️' }, chore: { description: '其他', title: 'Chores', emoji: '♻️' } } } } } };