File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 3535 . option ( '--include-locked, -l' , 'include locked dependencies & devDependencies' )
3636 . option ( '--timediff' , 'show time difference between the current and the updated version' )
3737 . action ( async ( mode : RangeMode | undefined , options : Partial < CheckOptions > ) => {
38- mode ||= 'default'
39- if ( ! MODE_CHOICES . includes ( mode ) ) {
40- console . error ( `Invalid mode: ${ mode } . Please use one of the following: ${ MODE_CHOICES . join ( '|' ) } ` )
41- process . exit ( 1 )
38+ if ( mode ) {
39+ if ( ! MODE_CHOICES . includes ( mode ) ) {
40+ console . error ( `Invalid mode: ${ mode } . Please use one of the following: ${ MODE_CHOICES . join ( '|' ) } ` )
41+ process . exit ( 1 )
42+ }
43+ options . mode = mode
4244 }
45+ const resolved = await resolveConfig ( options )
46+
4347 let exitCode
4448 if ( options . global )
45- exitCode = await checkGlobal ( await resolveConfig ( { ... options , mode } as CheckOptions ) )
49+ exitCode = await checkGlobal ( resolved )
4650 else
47- exitCode = await check ( await resolveConfig ( { ... options , mode } as CheckOptions ) )
51+ exitCode = await check ( resolved )
4852
4953 process . exit ( exitCode )
5054 } )
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ export async function resolveConfig(
5050 const config = await loader . load ( )
5151
5252 if ( ! config . sources . length )
53- return deepmerge ( defaults , options as T ) as T
53+ return deepmerge ( defaults , options )
5454
5555 debug ( `config file found ${ config . sources [ 0 ] } ` )
5656 const configOptions = normalizeConfig ( config . config )
5757
58- return deepmerge ( deepmerge ( defaults , configOptions ) , options as T ) as T
58+ return deepmerge ( deepmerge ( defaults , configOptions ) , options )
5959}
You can’t perform that action at this time.
0 commit comments