@@ -8,39 +8,57 @@ The file is expected
8
8
- export a configuration object
9
9
- adhere to the schema outlined below
10
10
11
- ``` ts
12
- type Config = {
11
+ ## Configuration object example
12
+
13
+ ### JavaScript
14
+
15
+ ``` js
16
+ const Configuration = {
13
17
/*
14
- * Resolveable ids to commitlint configurations to extend
18
+ * Resolve and load @commitlint/config-conventional from node_modules.
19
+ * Referenced packages must be installed
15
20
*/
16
- extends? : string [];
21
+ extends: [ ' @commitlint/config-conventional ' ],
17
22
/*
18
- * Resolveable id to conventional-changelog parser preset to import and use
23
+ * Resolve and load conventional-changelog-atom from node_modules.
24
+ * Referenced packages must be installed
19
25
*/
20
- parserPreset? : string ;
26
+ parserPreset: ' conventional-changelog-atom ' ,
21
27
/*
22
- * Resolveable id to package, from node_modules, which formats the output.
28
+ * Resolve and load @commitlint/format from node_modules.
29
+ * Referenced package must be installed
23
30
*/
24
- formatter: string ;
31
+ formatter: ' @commitlint/format ' ,
25
32
/*
26
- * Rules to check against
33
+ * Any rules defined here will override rules from @commitlint/config-conventional
27
34
*/
28
- rules? : {[name : string ]: Rule };
35
+ rules: {
36
+ ' type-enum' : [2 , ' always' , [' foo' ]],
37
+ },
29
38
/*
30
39
* Functions that return true if commitlint should ignore the given message.
31
40
*/
32
- ignores? : (( message : string ) => boolean )[];
41
+ ignores: [( commit ) => commit === ' ' ],
33
42
/*
34
43
* Whether commitlint uses the default ignore rules.
35
44
*/
36
- defaultIgnores? : boolean ;
45
+ defaultIgnores: true ,
37
46
/*
38
47
* Custom URL to show upon failure
39
48
*/
40
- helpUrl? : string ;
49
+ helpUrl:
50
+ ' https://github.com/conventional-changelog/commitlint/#what-is-commitlint' ,
41
51
};
42
52
43
- const Configuration: Config = {
53
+ module .exports = Configuration;
54
+ ```
55
+
56
+ ### TypeScript
57
+
58
+ ``` ts
59
+ import type {UserConfig } from ' @commitlint/types' ;
60
+
61
+ const Configuration: UserConfig = {
44
62
/*
45
63
* Resolve and load @commitlint/config-conventional from node_modules.
46
64
* Referenced packages must be installed
0 commit comments