|
| 1 | +/** |
| 2 | + * This commitlint config file extends the conventional configuration |
| 3 | + * and adds the following customizations: |
| 4 | + * |
| 5 | + * - Ignores commit messages that start with "Merge" |
| 6 | + * - Allows the following commit types: |
| 7 | + * - build |
| 8 | + * - chore |
| 9 | + * - ci |
| 10 | + * - docs |
| 11 | + * - feat |
| 12 | + * - fix |
| 13 | + * - perf |
| 14 | + * - refactor |
| 15 | + * - revert |
| 16 | + * - style |
| 17 | + * - test |
| 18 | + * - Merge |
| 19 | + * |
| 20 | + * Please see the commitlint documentation for more information on how to use |
| 21 | + * this configuration file: |
| 22 | + * https://commitlint.js.org/reference/rules.html |
| 23 | + * |
| 24 | + */ |
| 25 | +const RuleConfigSeverity = { |
| 26 | + Disabled: 0, |
| 27 | + Warning: 1, |
| 28 | + Error: 2, |
| 29 | +}; |
| 30 | + |
| 31 | +module.exports = { |
| 32 | + ignores: [(message) => message.startsWith("Merge")], |
| 33 | + rules: { |
| 34 | + "type-enum": [ |
| 35 | + 2, |
| 36 | + "always", |
| 37 | + [ |
| 38 | + "build", |
| 39 | + "chore", |
| 40 | + "ci", |
| 41 | + "docs", |
| 42 | + "feat", |
| 43 | + "fix", |
| 44 | + "perf", |
| 45 | + "refactor", |
| 46 | + "revert", |
| 47 | + "style", |
| 48 | + "test", |
| 49 | + ], |
| 50 | + ], |
| 51 | + "body-case": [RuleConfigSeverity.Disabled, "always"], |
| 52 | + "body-leading-blank": [RuleConfigSeverity.Warning, "always"], |
| 53 | + "body-max-line-length": [RuleConfigSeverity.Disabled, "always"], |
| 54 | + "footer-leading-blank": [RuleConfigSeverity.Warning, "always"], |
| 55 | + "footer-max-line-length": [RuleConfigSeverity.Disabled, "always"], |
| 56 | + "header-max-length": [RuleConfigSeverity.Disabled, "always"], |
| 57 | + "header-trim": [RuleConfigSeverity.Error, "always"], |
| 58 | + "scope-case": [RuleConfigSeverity.Error, "always", "lower-case"], |
| 59 | + "subject-case": [RuleConfigSeverity.Disabled, "always"], |
| 60 | + "subject-empty": [RuleConfigSeverity.Error, "never"], |
| 61 | + "subject-full-stop": [RuleConfigSeverity.Error, "never", "."], |
| 62 | + "type-case": [RuleConfigSeverity.Error, "always", "lower-case"], |
| 63 | + "type-empty": [RuleConfigSeverity.Error, "never"], |
| 64 | + }, |
| 65 | +}; |
0 commit comments