@@ -4370,8 +4370,8 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
43704370 createDiagnosticForOptionName ( Diagnostics . Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler , "customConditions" ) ;
43714371 }
43724372
4373- if ( moduleResolution === ModuleResolutionKind . Bundler && ! emitModuleKindIsNonNodeESM ( moduleKind ) && moduleKind !== ModuleKind . Preserve ) {
4374- createOptionValueDiagnostic ( "moduleResolution" , Diagnostics . Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later , "bundler" ) ;
4373+ if ( moduleResolution === ModuleResolutionKind . Bundler && ! emitModuleKindIsNonNodeESM ( moduleKind ) && moduleKind !== ModuleKind . Preserve && moduleKind !== ModuleKind . CommonJS ) {
4374+ createOptionValueDiagnostic ( "moduleResolution" , Diagnostics . Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later , "bundler" ) ;
43754375 }
43764376
43774377 if (
@@ -4435,10 +4435,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
44354435 function getIgnoreDeprecationsVersion ( ) : Version {
44364436 const ignoreDeprecations = options . ignoreDeprecations ;
44374437 if ( ignoreDeprecations ) {
4438- // While we could do Version.tryParse here to support any version,
4439- // for now, only allow "5.0". We aren't planning on deprecating anything
4440- // until 6.0.
4441- if ( ignoreDeprecations === "5.0" ) {
4438+ if ( ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0" ) {
44424439 return new Version ( ignoreDeprecations ) ;
44434440 }
44444441 reportInvalidIgnoreDeprecations ( ) ;
@@ -4526,6 +4523,12 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
45264523 createDeprecatedDiagnostic ( "preserveValueImports" , /*value*/ undefined , "verbatimModuleSyntax" ) ;
45274524 }
45284525 } ) ;
4526+
4527+ checkDeprecations ( "6.0" , "7.0" , createDiagnostic , createDeprecatedDiagnostic => {
4528+ if ( options . moduleResolution === ModuleResolutionKind . Node10 ) {
4529+ createDeprecatedDiagnostic ( "moduleResolution" , "node10" ) ;
4530+ }
4531+ } ) ;
45294532 }
45304533
45314534 function verifyDeprecatedProjectReference ( ref : ProjectReference , parentFile : JsonSourceFile | undefined , index : number ) {
0 commit comments