@@ -961,12 +961,15 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
961961 {
962962 name : "moduleResolution" ,
963963 type : new Map ( getEntries ( {
964- node : ModuleResolutionKind . NodeJs ,
964+ // N.B. The first entry specifies the value shown in `tsc --init`
965+ node10 : ModuleResolutionKind . Node10 ,
966+ node : ModuleResolutionKind . Node10 ,
965967 classic : ModuleResolutionKind . Classic ,
966968 node16 : ModuleResolutionKind . Node16 ,
967969 nodenext : ModuleResolutionKind . NodeNext ,
968970 bundler : ModuleResolutionKind . Bundler ,
969971 } ) ) ,
972+ deprecatedKeys : new Set ( [ "node" ] ) ,
970973 affectsModuleResolution : true ,
971974 paramType : Diagnostics . STRATEGY ,
972975 category : Diagnostics . Modules ,
@@ -1685,8 +1688,9 @@ export function createCompilerDiagnosticForInvalidCustomType(opt: CommandLineOpt
16851688}
16861689
16871690function createDiagnosticForInvalidCustomType ( opt : CommandLineOptionOfCustomType , createDiagnostic : ( message : DiagnosticMessage , arg0 : string , arg1 : string ) => Diagnostic ) : Diagnostic {
1688- const namesOfType = arrayFrom ( opt . type . keys ( ) ) . map ( key => `'${ key } '` ) . join ( ", " ) ;
1689- return createDiagnostic ( Diagnostics . Argument_for_0_option_must_be_Colon_1 , `--${ opt . name } ` , namesOfType ) ;
1691+ const namesOfType = arrayFrom ( opt . type . keys ( ) ) ;
1692+ const stringNames = ( opt . deprecatedKeys ? namesOfType . filter ( k => ! opt . deprecatedKeys ! . has ( k ) ) : namesOfType ) . map ( key => `'${ key } '` ) . join ( ", " ) ;
1693+ return createDiagnostic ( Diagnostics . Argument_for_0_option_must_be_Colon_1 , `--${ opt . name } ` , stringNames ) ;
16901694}
16911695
16921696/** @internal */
@@ -3404,7 +3408,7 @@ function getExtendsConfigPath(
34043408 return extendedConfigPath ;
34053409 }
34063410 // If the path isn't a rooted or relative path, resolve like a module
3407- const resolved = nodeModuleNameResolver ( extendedConfig , combinePaths ( basePath , "tsconfig.json" ) , { moduleResolution : ModuleResolutionKind . NodeJs } , host , /*cache*/ undefined , /*projectRefs*/ undefined , /*lookupConfig*/ true ) ;
3411+ const resolved = nodeModuleNameResolver ( extendedConfig , combinePaths ( basePath , "tsconfig.json" ) , { moduleResolution : ModuleResolutionKind . Node10 } , host , /*cache*/ undefined , /*projectRefs*/ undefined , /*lookupConfig*/ true ) ;
34083412 if ( resolved . resolvedModule ) {
34093413 return resolved . resolvedModule . resolvedFileName ;
34103414 }
0 commit comments