@@ -370,19 +370,19 @@ export async function resolveApis({
370370 return resolvedApis ;
371371}
372372
373- async function resolveAndMergeNestedStyleguideConfig (
374- {
375- styleguideConfig ,
376- configPath = '' ,
377- resolver = new BaseResolver ( ) ,
378- } : {
379- styleguideConfig ?: StyleguideRawConfig ;
380- configPath ?: string ;
381- resolver ?: BaseResolver ;
382- } ,
383- parentConfigPaths : string [ ] = [ ] ,
384- extendPaths : string [ ] = [ ]
385- ) : Promise < ResolvedStyleguideConfig > {
373+ async function resolveAndMergeNestedStyleguideConfig ( {
374+ styleguideConfig ,
375+ configPath = '' ,
376+ resolver = new BaseResolver ( ) ,
377+ parentConfigPaths = [ ] ,
378+ extendPaths = [ ] ,
379+ } : {
380+ styleguideConfig ?: StyleguideRawConfig ;
381+ configPath ?: string ;
382+ resolver ?: BaseResolver ;
383+ parentConfigPaths ? : string [ ] ;
384+ extendPaths ? : string [ ] ;
385+ } ) : Promise < ResolvedStyleguideConfig > {
386386 if ( parentConfigPaths . includes ( configPath ) ) {
387387 throw new Error ( `Circular dependency in config file: "${ configPath } "` ) ;
388388 }
@@ -414,15 +414,13 @@ async function resolveAndMergeNestedStyleguideConfig(
414414 ? new URL ( presetItem , configPath ) . href
415415 : path . resolve ( path . dirname ( configPath ) , presetItem ) ;
416416 const extendedStyleguideConfig = await loadExtendStyleguideConfig ( pathItem , resolver ) ;
417- return await resolveAndMergeNestedStyleguideConfig (
418- {
419- styleguideConfig : extendedStyleguideConfig ,
420- configPath : pathItem ,
421- resolver : resolver ,
422- } ,
423- [ ...parentConfigPaths , resolvedConfigPath ] ,
424- extendPaths
425- ) ;
417+ return await resolveAndMergeNestedStyleguideConfig ( {
418+ styleguideConfig : extendedStyleguideConfig ,
419+ configPath : pathItem ,
420+ resolver,
421+ parentConfigPaths : [ ...parentConfigPaths , resolvedConfigPath ] ,
422+ extendPaths,
423+ } ) ;
426424 } ) || [ ]
427425 ) ;
428426
@@ -446,20 +444,14 @@ async function resolveAndMergeNestedStyleguideConfig(
446444 } ;
447445}
448446
449- export async function resolveStyleguideConfig (
450- opts : {
451- styleguideConfig ?: StyleguideRawConfig ;
452- configPath ?: string ;
453- resolver ?: BaseResolver ;
454- } ,
455- parentConfigPaths : string [ ] = [ ] ,
456- extendPaths : string [ ] = [ ]
457- ) : Promise < ResolvedStyleguideConfig > {
458- const resolvedStyleguideConfig = await resolveAndMergeNestedStyleguideConfig (
459- opts ,
460- parentConfigPaths ,
461- extendPaths
462- ) ;
447+ export async function resolveStyleguideConfig ( opts : {
448+ styleguideConfig ?: StyleguideRawConfig ;
449+ configPath ?: string ;
450+ resolver ?: BaseResolver ;
451+ parentConfigPaths ?: string [ ] ;
452+ extendPaths ?: string [ ] ;
453+ } ) : Promise < ResolvedStyleguideConfig > {
454+ const resolvedStyleguideConfig = await resolveAndMergeNestedStyleguideConfig ( opts ) ;
463455
464456 return {
465457 ...resolvedStyleguideConfig ,
0 commit comments