File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 35
35
. option ( '--include-locked, -l' , 'include locked dependencies & devDependencies' )
36
36
. option ( '--timediff' , 'show time difference between the current and the updated version' )
37
37
. 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
42
44
}
45
+ const resolved = await resolveConfig ( options )
46
+
43
47
let exitCode
44
48
if ( options . global )
45
- exitCode = await checkGlobal ( await resolveConfig ( { ... options , mode } as CheckOptions ) )
49
+ exitCode = await checkGlobal ( resolved )
46
50
else
47
- exitCode = await check ( await resolveConfig ( { ... options , mode } as CheckOptions ) )
51
+ exitCode = await check ( resolved )
48
52
49
53
process . exit ( exitCode )
50
54
} )
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ export async function resolveConfig(
50
50
const config = await loader . load ( )
51
51
52
52
if ( ! config . sources . length )
53
- return deepmerge ( defaults , options as T ) as T
53
+ return deepmerge ( defaults , options )
54
54
55
55
debug ( `config file found ${ config . sources [ 0 ] } ` )
56
56
const configOptions = normalizeConfig ( config . config )
57
57
58
- return deepmerge ( deepmerge ( defaults , configOptions ) , options as T ) as T
58
+ return deepmerge ( deepmerge ( defaults , configOptions ) , options )
59
59
}
You can’t perform that action at this time.
0 commit comments