.commitlintrc.js 857 B

12345678910111213141516171819202122232425262728293031323334
  1. // 这里是通俗的解释 详情请前往官方文档查阅
  2. module.exports = {
  3. ignores: [(commit) => commit.includes("init")],
  4. extends: ["@commitlint/config-conventional"],
  5. rules: {
  6. // 信息以空格开头
  7. "body-leading-blank": [2, "always"],
  8. "footer-leading-blank": [2, "always"], // 信息最大长度
  9. "header-max-length": [2, "always", 108], // 信息不能未空
  10. "subject-empty": [2, "never"], // 信息类型不能未空
  11. "type-empty": [2, "never"], // 提交信息的类型 下文有介绍
  12. "type-enum": [
  13. 2,
  14. "always",
  15. [
  16. "feat",
  17. "fix",
  18. "perf",
  19. "style",
  20. "docs",
  21. "test",
  22. "refactor",
  23. "build",
  24. "ci",
  25. "chore",
  26. "revert",
  27. "wip",
  28. "workflow",
  29. "types",
  30. "release",
  31. ],
  32. ],
  33. },
  34. };