-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
38 lines (36 loc) · 1.84 KB
/
commitlint.config.js
File metadata and controls
38 lines (36 loc) · 1.84 KB
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
module.exports = {
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'refactor', 'test', 'docs', 'chore']],
'scope-empty': [2, 'never'],
'subject-empty': [2, 'never'],
'header-max-length': [2, 'always', 72],
'body-max-line-length': [2, 'always', 72],
'footer-max-line-length': [2, 'always', 72],
'subject-case': [2, 'always', 'lower-case'],
'subject-full-stop': [2, 'never', '.'],
'subject-min-length': [2, 'always', 3],
'body-leading-blank': [2, 'always'],
},
customRules: {
bodyRequiredForTypes: ['feat', 'fix', 'refactor', 'test', 'docs', 'chore'],
enforceBreakingChangeConsistency: true,
footerCountsAsBody: true,
messages: {
headerFormat: 'Header must follow format: type(scope): description',
invalidType: 'Invalid commit type. Valid types: feat, fix, refactor, test, docs, chore',
scopeRequired: 'Scope is required and cannot be empty. Use format: type(scope): description',
descriptionRequired: 'Description is required after ": "',
descriptionTooShort: 'Description too short (minimum 3 characters)',
lowercaseRequired: 'Description should start with lowercase letter',
noTrailingPeriod: 'Header should not end with a period',
headerTooLong: 'Header too long ({length} chars, max 72)',
bodyRequiredForType: 'Body is required for {type} commits. Add a blank line after header, then describe what and why.',
bodyLeadingBlank: 'Blank line required after header',
bodyLineTooLong: 'Body line too long ({length} chars, max 72)',
footerLineTooLong: 'Footer line too long ({length} chars, max 72)',
breakingNeedsFooter: "Breaking change '!' in header requires 'BREAKING CHANGE:' in footer",
footerNeedsBang: "'BREAKING CHANGE:' in footer requires '!' in header",
cannotBeEmpty: 'Commit message cannot be empty',
}
}
};