commitlint.config.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. module.exports = {
  2. parserPreset: "conventional-changelog-conventionalcommits",
  3. rules: {
  4. "body-leading-blank": [1, "always"],
  5. "body-max-line-length": [2, "always", 100],
  6. "footer-leading-blank": [1, "always"],
  7. "footer-max-line-length": [2, "always", 100],
  8. "header-max-length": [2, "always", 100],
  9. "subject-case": [
  10. 2,
  11. "never",
  12. ["sentence-case", "start-case", "pascal-case", "upper-case"],
  13. ],
  14. "subject-empty": [2, "never"],
  15. "subject-full-stop": [2, "never", "."],
  16. "type-case": [2, "always", "lower-case"],
  17. "type-empty": [2, "never"],
  18. "type-enum": [
  19. 2,
  20. "always",
  21. [
  22. "build",
  23. "chore",
  24. "ci",
  25. "docs",
  26. "feat",
  27. "fix",
  28. "perf",
  29. "refactor",
  30. "revert",
  31. "style",
  32. "test",
  33. ],
  34. ],
  35. },
  36. prompt: {
  37. questions: {
  38. type: {
  39. description: "Select the type of change that you're committing",
  40. enum: {
  41. feat: {
  42. description: "A new feature",
  43. title: "Features",
  44. emoji: "✨",
  45. },
  46. fix: {
  47. description: "A bug fix",
  48. title: "Bug Fixes",
  49. emoji: "🐛",
  50. },
  51. docs: {
  52. description: "Documentation only changes",
  53. title: "Documentation",
  54. emoji: "📚",
  55. },
  56. style: {
  57. description:
  58. "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
  59. title: "Styles",
  60. emoji: "💎",
  61. },
  62. refactor: {
  63. description: "A code change that neither fixes a bug nor adds a feature",
  64. title: "Code Refactoring",
  65. emoji: "📦",
  66. },
  67. perf: {
  68. description: "A code change that improves performance",
  69. title: "Performance Improvements",
  70. emoji: "🚀",
  71. },
  72. test: {
  73. description: "Adding missing tests or correcting existing tests",
  74. title: "Tests",
  75. emoji: "🚨",
  76. },
  77. build: {
  78. description:
  79. "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
  80. title: "Builds",
  81. emoji: "🛠",
  82. },
  83. ci: {
  84. description:
  85. "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
  86. title: "Continuous Integrations",
  87. emoji: "⚙️",
  88. },
  89. chore: {
  90. description: "Other changes that don't modify src or test files",
  91. title: "Chores",
  92. emoji: "♻️",
  93. },
  94. revert: {
  95. description: "Reverts a previous commit",
  96. title: "Reverts",
  97. emoji: "🗑",
  98. },
  99. },
  100. },
  101. scope: {
  102. description: "What is the scope of this change (e.g. component or file name)",
  103. },
  104. subject: {
  105. description: "Write a short, imperative tense description of the change",
  106. },
  107. body: {
  108. description: "Provide a longer description of the change",
  109. },
  110. isBreaking: {
  111. description: "Are there any breaking changes?",
  112. },
  113. breakingBody: {
  114. description:
  115. "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
  116. },
  117. breaking: {
  118. description: "Describe the breaking changes",
  119. },
  120. isIssueAffected: {
  121. description: "Does this change affect any open issues?",
  122. },
  123. issuesBody: {
  124. description:
  125. "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
  126. },
  127. issues: {
  128. description: 'Add issue references (e.g. "fix #123", "re #123".)',
  129. },
  130. },
  131. },
  132. };