commitlint.config.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /** @type {import('cz-git').UserConfig} */
  2. export default {
  3. rules: {
  4. // @see: https://commitlint.js.org/#/reference-rules
  5. },
  6. extends: ['@commitlint/config-conventional'],
  7. prompt: {
  8. messages: {
  9. type: '选择你要提交的类型 :',
  10. scope: '选择一个提交范围:',
  11. subject: '填写简短精炼的变更描述 :\n',
  12. body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
  13. breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
  14. footer: '列举出禅道中的bug编号(可选)。 例如: #31, #34:\n',
  15. confirmCommit: '是否提交commit ?',
  16. },
  17. types: [
  18. { value: 'feat', name: 'feat: 新功能' },
  19. { value: 'fix', name: 'fix: 修复问题' },
  20. { value: 'docs', name: 'docs: 文档更改' },
  21. { value: 'style', name: 'style: 格式(不影响代码运行的变动)' },
  22. { value: 'refactor', name: 'refactor: 重构(即不是新增功能,也不是修改bug的代码变动)' },
  23. { value: 'perf', name: 'perf: 性能优化' },
  24. { value: 'build', name: 'build: 影响构建系统或外部依赖的变更(例如:vite,npm)' },
  25. { value: 'ci', name: 'ci: 对 CI 配置文件和脚本的更改(例如:Travis, Circle, BrowserStack, SauceLabs)' },
  26. { value: 'chore', name: 'chore: 其他修改(不修改src目录或测试文件的修改)' },
  27. { value: 'revert', name: 'revert: 撤销之前的提交' },
  28. ],
  29. // 是否开启emoji表情
  30. useEmoji: false,
  31. // 自定义“模块范围”列表
  32. scopes: [
  33. 'pages',
  34. 'components',
  35. 'constants',
  36. 'directives',
  37. 'stores',
  38. 'router',
  39. 'utils',
  40. 'hooks',
  41. 'styles',
  42. 'config',
  43. 'assets',
  44. 'types',
  45. 'docs',
  46. 'other',
  47. ],
  48. // 是否在选择“模块范围”中显示“自定义(custom)”选项
  49. allowCustomScopes: false,
  50. // 是否在选择“模块范围”中显示“空(empty)”选项
  51. allowEmptyScopes: false,
  52. // 允许出现的非兼容性重大的变更的 type
  53. allowBreakingChanges: ['feat', 'fix', 'refactor'],
  54. // 定义 header 长度
  55. maxHeaderLength: 79,
  56. },
  57. };