@@ -31,7 +31,8 @@ const rules = {
3131
3232const configuration = {
3333 // flags of string type
34- string : [ 'from' , 'to' , 'preset' ] ,
34+ string : [ 'from' , 'to' , 'preset' , 'extends' ] ,
35+ // flags of array type
3536 // flags of bool type
3637 boolean : [ 'edit' , 'help' , 'version' , 'quiet' , 'color' ] ,
3738 // flag aliases
@@ -43,11 +44,13 @@ const configuration = {
4344 t : 'to' ,
4445 q : 'quiet' ,
4546 h : 'help' ,
46- v : 'version'
47+ v : 'version' ,
48+ x : 'extends'
4749 } ,
4850 description : {
4951 color : 'toggle formatted output' ,
5052 edit : 'read last commit message found in ./git/COMMIT_EDITMSG' ,
53+ 'extends' : 'array of shareable configurations to extend' ,
5154 from : 'lower end of the commit range to lint; applies if edit=false' ,
5255 preset : 'conventional-changelog-preset to use for commit message parsing' ,
5356 to : 'upper end of the commit range to lint; applies if edit=false' ,
@@ -89,9 +92,20 @@ async function main(options) {
8992 . map ( async commit => {
9093 const fmt = new chalk . constructor ( { enabled : flags . color } ) ;
9194
95+ const seed = { } ;
96+ if ( flags . extends ) {
97+ seed . extends = flags . extends . split ( ',' ) ;
98+ }
99+
92100 const report = lint ( commit , {
93101 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+ )
95109 } ) ;
96110
97111 const formatted = format ( report , {
0 commit comments