@@ -25,7 +25,7 @@ export default async function resolveExtends(config = {}, context = {}) {
25
25
26
26
// (any, string, string, Function) => any[];
27
27
async function loadExtends ( config = { } , context = { } ) {
28
- return ( config . extends || [ ] ) . reduce ( async ( configs , raw ) => {
28
+ return ( config . extends || [ ] ) . reduce ( async ( accing , raw ) => {
29
29
const load = context . require || require ;
30
30
const resolved = resolveConfig ( raw , context ) ;
31
31
const c = load ( resolved ) ;
@@ -52,46 +52,11 @@ async function loadExtends(config = {}, context = {}) {
52
52
config . parserPreset = parserPreset ;
53
53
}
54
54
55
- return [ ...configs , c , ...( await loadExtends ( c , ctx ) ) ] ;
55
+ const acc = await accing ;
56
+ acc . push ( c ) ;
57
+ acc . push ( ...( await loadExtends ( c , ctx ) ) ) ;
58
+ return acc ;
56
59
} , Promise . resolve ( [ ] ) ) ;
57
-
58
- /* Return (config.extends || []).reduce((configs, raw) => {
59
- const load = context.require || require;
60
- const resolved = resolveConfig(raw, context);
61
- const c = load(resolved);
62
- const cwd = path.dirname(resolved);
63
-
64
- // Remove deprecation warning in version 3
65
- if (typeof c === 'object' && 'wildcards' in c) {
66
- console.warn(
67
- `'wildcards' found in '${raw}' ignored. To silence this warning raise an issue at 'npm repo ${raw}' to remove the wildcards.`
68
- );
69
- }
70
-
71
- const ctx = merge({}, context, {cwd});
72
-
73
- // Resolve parser preset if none was present before
74
- if (
75
- !context.parserPreset &&
76
- typeof c === 'object' &&
77
- typeof c.parserPreset === 'string'
78
- ) {
79
- const resolvedParserPreset = resolveFrom(cwd, c.parserPreset);
80
-
81
- const parserPreset = {
82
- name: c.parserPreset,
83
- path: `./${path.relative(process.cwd(), resolvedParserPreset)}`
84
- .split(path.sep)
85
- .join('/'),
86
- opts: require(resolvedParserPreset)
87
- };
88
-
89
- ctx.parserPreset = parserPreset;
90
- config.parserPreset = parserPreset;
91
- }
92
-
93
- return [...configs, c, ...loadExtends(c, ctx)];
94
- }, []); */
95
60
}
96
61
97
62
function getId ( raw = '' , prefix = '' ) {
@@ -111,11 +76,7 @@ function resolveConfig(raw, context = {}) {
111
76
const legacy = getId ( raw , 'conventional-changelog-lint-config' ) ;
112
77
const resolved = resolve ( legacy , context ) ;
113
78
console . warn (
114
- `Resolving ${ raw } to legacy config ${
115
- legacy
116
- } . To silence this warning raise an issue at 'npm repo ${
117
- legacy
118
- } ' to rename to ${ id } .`
79
+ `Resolving ${ raw } to legacy config ${ legacy } . To silence this warning raise an issue at 'npm repo ${ legacy } ' to rename to ${ id } .`
119
80
) ;
120
81
return resolved ;
121
82
}
0 commit comments