-
Notifications
You must be signed in to change notification settings - Fork 16
/
.commitlint.config.mjs
42 lines (41 loc) · 1.75 KB
/
.commitlint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* [commitlint](https://github.com/conventional-changelog/commitlint) configuration */
import {
RuleConfigSeverity,
} from '@commitlint/types';
export default {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'header-max-length': [RuleConfigSeverity.Error, 'always', 72], // Header should be 72 characters or shorter
'header-trim': [RuleConfigSeverity.Error, 'always'], // No leading/trailing whitespace in header
'subject-empty': [RuleConfigSeverity.Error, 'never'], // No empty subject
'subject-case': [ // Subject line should be lowercase
RuleConfigSeverity.Error,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
'subject-full-stop': [RuleConfigSeverity.Error, 'never'], // No full-stop at end of subject
'body-max-line-length': [RuleConfigSeverity.Error, 'always', 72], // Body lines should be 72 characteres or shorter
'body-leading-blank': [RuleConfigSeverity.Error, 'always'], // Empty line before body
'type-empty': [RuleConfigSeverity.Error, 'never'], // Commit type must be present
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'], // Commit type should be lowercase
'type-enum': [ // Commit type allowlist
RuleConfigSeverity.Error,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
ignores: [
(message) => message.includes("Merge pull request #"), // PR merges are allowed
],
};