@@ -31,7 +31,8 @@ const rules = {
31
31
32
32
const configuration = {
33
33
// flags of string type
34
- string : [ 'from' , 'to' , 'preset' ] ,
34
+ string : [ 'from' , 'to' , 'preset' , 'extends' ] ,
35
+ // flags of array type
35
36
// flags of bool type
36
37
boolean : [ 'edit' , 'help' , 'version' , 'quiet' , 'color' ] ,
37
38
// flag aliases
@@ -43,11 +44,13 @@ const configuration = {
43
44
t : 'to' ,
44
45
q : 'quiet' ,
45
46
h : 'help' ,
46
- v : 'version'
47
+ v : 'version' ,
48
+ x : 'extends'
47
49
} ,
48
50
description : {
49
51
color : 'toggle formatted output' ,
50
52
edit : 'read last commit message found in ./git/COMMIT_EDITMSG' ,
53
+ 'extends' : 'array of shareable configurations to extend' ,
51
54
from : 'lower end of the commit range to lint; applies if edit=false' ,
52
55
preset : 'conventional-changelog-preset to use for commit message parsing' ,
53
56
to : 'upper end of the commit range to lint; applies if edit=false' ,
@@ -89,9 +92,20 @@ async function main(options) {
89
92
. map ( async commit => {
90
93
const fmt = new chalk . constructor ( { enabled : flags . color } ) ;
91
94
95
+ const seed = { } ;
96
+ if ( flags . extends ) {
97
+ seed . extends = flags . extends . split ( ',' ) ;
98
+ }
99
+
92
100
const report = lint ( commit , {
93
101
preset : await getPreset ( flags . preset ) ,
94
- configuration : await getConfiguration ( )
102
+ configuration : await getConfiguration (
103
+ 'conventional-changelog-lint' ,
104
+ {
105
+ prefix : 'conventional-changelog-lint-config'
106
+ } ,
107
+ seed
108
+ )
95
109
} ) ;
96
110
97
111
const formatted = format ( report , {
0 commit comments