.commitlintrc.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /** @type {import('cz-git').UserConfig} */
  2. export default {
  3. rules: {
  4. // @see: https://commitlint.js.org/#/reference-rules
  5. },
  6. prompt: {
  7. alias: { fd: 'docs: fix typos' },
  8. messages: {
  9. type: '选择你要提交的类型 :',
  10. scope: '选择一个提交范围(可选):',
  11. customScope: '请输入自定义的提交范围 :',
  12. subject: '填写简短精炼的变更描述 :\n',
  13. body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
  14. breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
  15. footerPrefixsSelect: '选择关联issue前缀(可选):',
  16. customFooterPrefixs: '输入自定义issue前缀 :',
  17. footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
  18. confirmCommit: '是否提交或修改commit ?',
  19. },
  20. types: [
  21. { value: 'feat', name: 'feat: ✨ 新增功能 | A new feature', emoji: ':sparkles:' },
  22. { value: 'fix', name: 'fix: 🐛 修复缺陷 | A bug fix', emoji: ':bug:' },
  23. { value: 'docs', name: 'docs: 📝 文档更新 | Documentation only changes', emoji: ':memo:' },
  24. { value: 'style', name: 'style: 💄 代码格式 | Changes that do not affect the meaning of the code', emoji: ':lipstick:' },
  25. { value: 'refactor', name: 'refactor: ♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature', emoji: ':recycle:' },
  26. { value: 'perf', name: 'perf: ⚡️ 性能提升 | A code change that improves performance', emoji: ':zap:' },
  27. { value: 'test', name: 'test: ✅ 测试相关 | Adding missing tests or correcting existing tests', emoji: ':white_check_mark:' },
  28. { value: 'build', name: 'build: 📦️ 构建相关 | Changes that affect the build system or external dependencies', emoji: ':package:' },
  29. { value: 'ci', name: 'ci: 🎡 持续集成 | Changes to our CI configuration files and scripts', emoji: ':ferris_wheel:' },
  30. { value: 'revert', name: 'revert: ⏪️ 回退代码 | Revert to a commit', emoji: ':rewind:' },
  31. { value: 'chore', name: 'chore: 🔨 其他修改 | Other changes that do not modify src or test files', emoji: ':hammer:' },
  32. ],
  33. useEmoji: false,
  34. emojiAlign: 'center',
  35. themeColorCode: '',
  36. scopes: [],
  37. allowCustomScopes: true,
  38. allowEmptyScopes: true,
  39. customScopesAlign: 'bottom',
  40. customScopesAlias: 'custom',
  41. emptyScopesAlias: 'empty',
  42. upperCaseSubject: false,
  43. markBreakingChangeMode: true,
  44. allowBreakingChanges: ['feat', 'fix'],
  45. breaklineNumber: 100,
  46. breaklineChar: '|',
  47. skipQuestions: [],
  48. issuePrefixs: [
  49. // 如果使用 gitee 作为开发管理
  50. { value: 'link', name: 'link: 链接 ISSUES 进行中' },
  51. { value: 'closed', name: 'closed: 标记 ISSUES 已完成' },
  52. ],
  53. customIssuePrefixsAlign: 'top',
  54. emptyIssuePrefixsAlias: 'skip',
  55. customIssuePrefixsAlias: 'custom',
  56. allowCustomIssuePrefixs: true,
  57. allowEmptyIssuePrefixs: true,
  58. confirmColorize: true,
  59. maxHeaderLength: Number.POSITIVE_INFINITY,
  60. maxSubjectLength: Number.POSITIVE_INFINITY,
  61. minSubjectLength: 0,
  62. scopeOverrides: undefined,
  63. defaultBody: '',
  64. defaultIssues: '',
  65. defaultScope: '',
  66. defaultSubject: '',
  67. },
  68. }