-
Notifications
You must be signed in to change notification settings - Fork 1
/
commitlint.config.ts
94 lines (86 loc) · 2.48 KB
/
commitlint.config.ts
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Types
import type { UserConfig } from '@commitlint/types';
// External dependencies
import { RuleConfigSeverity } from '@commitlint/types';
/**
*
* `commitlint` configuration.
*
* @see https://commitlint.js.org/#/reference-configuration
*
* ---
*
* Parts of a commit message:
*
* ```plaintext
* type(scope): subject
* <BLANK LINE>
* body
* <BLANK LINE>
* footer
* ```
*
* By `header`, we mean the `type(scope): subject` part.
*
* @see https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits
*
*/
const Configuration: UserConfig = {
/**
* Resolve and load `@commitlint/config-conventional` from node_modules.
*/
extends: ['@commitlint/config-conventional'],
/**
* Rules are made up by a name and a configuration array.
*
* ```js
* '<rule-name>': [<severity>, <applicability>, <value>]
* ```
*
* - `<severity>`:
* - `0` (or `RuleConfigSeverity.Disabled`): violation of rule does
* nothing. This effectively disables the rule.
* - `1` (or `RuleConfigSeverity.Warning`): violation of rule throws
* warning.
* - `2` (or `RuleConfigSeverity.Error`): violation of rule throws error.
*
* - `<applicability>`:
* - `'always'`: rule should always pass.
* - `'never'`: rule should never pass. This effectively "inverts" the
* rule.
*
* - `<value>`: value to use for this rule.
*
* @example
* ```js
* "rules": {
* "header-max-length": [0, "always", 72]
* }
* ```
*/
rules: {
/**
* In `type(scope): subject`, `type` must always be lowercase.
*/
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
/**
* The header, i.e., `type(scope): subject`, must always be less than 50
* characters long in total.
*/
'header-max-length': [RuleConfigSeverity.Error, 'always', 50],
/**
* The `header` must always be preceded by a blank line.
*/
'body-leading-blank': [RuleConfigSeverity.Error, 'always'],
/**
* The body, i.e., the part after the header, must always be wrapped at
* 72 characters.
*/
'body-max-line-length': [RuleConfigSeverity.Error, 'always', 72],
/**
* The `footer` must always be preceded by a blank line.
*/
'footer-leading-blank': [RuleConfigSeverity.Error, 'always'],
},
};
export default Configuration;