commitlint.config.js 1.0 KB

1234567891011121314151617181920212223242526272829
  1. module.exports = {
  2. ignores: [commit => commit.includes('init')],
  3. extends: ['@commitlint/config-conventional'],
  4. rules: {
  5. 'body-leading-blank': [2, 'always'],
  6. 'footer-leading-blank': [1, 'always'],
  7. 'header-max-length': [2, 'always', 108],
  8. 'subject-empty': [2, 'never'],
  9. 'type-empty': [2, 'never'],
  10. 'type-enum': [
  11. 2,
  12. 'always',
  13. [
  14. 'feat', // 新增功能、变更需求
  15. 'fix', // 修复bug
  16. 'perf', // 优化性能
  17. 'refactor', // 代码重构
  18. 'style', // 代码格式(不影响功能,例如空格、分号等格式修正)
  19. 'docs', // 文档变更
  20. 'test', // 测试
  21. 'ci', // 更改持续集成软件的配置文件和package中的scripts命令,例如scopes: Travis, Circle等
  22. 'chore', // 变更构建流程或辅助工具(依赖更新/脚手架配置修改/webpack、gulp、npm等)
  23. 'revert', // 代码回退
  24. 'types', // ts类型定义文件更改
  25. 'wip', // work in process开发中
  26. ],
  27. ],
  28. },
  29. };