@@ -19,15 +19,13 @@ export default function resolveExtends(config = {}, context = {}) {
19
19
// (any, string, string, Function) => any[];
20
20
function loadExtends ( config = { } , context = { } ) {
21
21
return ( config . extends || [ ] ) . reduce ( ( configs , raw ) => {
22
- const id = getId ( raw , context . prefix ) ;
23
- const resolve = context . resolve || resolveId ;
24
- const resolved = resolve ( id , context ) ;
25
22
const load = context . require || require ;
23
+ const resolved = resolveConfig ( raw , context ) ;
26
24
const c = load ( resolved ) ;
27
25
28
26
// Remove deprecation warning in version 3
29
27
if ( typeof c === 'object' && 'wildcards' in c ) {
30
- console . warn ( `'wildcards' found in '${ id } ' ignored. Raise an issue at 'npm repo ${ id } ' to remove the wildcards and silence this warning .` ) ;
28
+ console . warn ( `'wildcards' found in '${ raw } ' ignored. To silence this warning raise an issue at 'npm repo ${ raw } ' to remove the wildcards.` ) ;
31
29
}
32
30
33
31
const ctx = merge ( { } , context , {
@@ -45,6 +43,20 @@ function getId(raw = '', prefix = '') {
45
43
return ( scoped || relative ) ? raw : [ prefix , raw ] . filter ( String ) . join ( '-' ) ;
46
44
}
47
45
46
+ function resolveConfig ( raw , context = { } ) {
47
+ const resolve = context . resolve || resolveId ;
48
+ const id = getId ( raw , context . prefix ) ;
49
+
50
+ try {
51
+ return resolve ( id , context ) ;
52
+ } catch ( err ) {
53
+ const legacy = getId ( raw , 'conventional-changelog-lint-config' ) ;
54
+ const resolved = resolve ( legacy , context ) ;
55
+ console . warn ( `Resolving ${ raw } to legacy config ${ legacy } . To silence this warning raise an issue at 'npm repo ${ legacy } ' to rename to ${ id } .` ) ;
56
+ return resolved ;
57
+ }
58
+ }
59
+
48
60
function resolveId ( id , context = { } ) {
49
61
return from ( context . cwd || process . cwd ( ) , id ) ;
50
62
}
0 commit comments