@typescript-deploys/pr-build 5.4.0-pr-56506-20 → 5.4.0-pr-56681-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -7353,6 +7353,9 @@ var Diagnostics = {
7353
7353
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
7354
7354
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
7355
7355
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
7356
+ Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules: diag(6805, 3 /* Message */, "Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules_6805", "Specify how files are determined to be ECMAScript modules or CommonJS modules."),
7357
+ Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation: diag(6806, 3 /* Message */, "Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation_6806", "Specify the target runtime's rules for ESM-CommonJS interoperation."),
7358
+ Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers: diag(6807, 3 /* Message */, "Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers_6807", "Specify defaults for module options suited for common runtimes and bundlers."),
7356
7359
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
7357
7360
  one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
7358
7361
  type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
@@ -7385,6 +7388,8 @@ var Diagnostics = {
7385
7388
  Compiles_the_current_project_with_additional_settings: diag(6929, 3 /* Message */, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
7386
7389
  true_for_ES2022_and_above_including_ESNext: diag(6930, 3 /* Message */, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
7387
7390
  List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1 /* Error */, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."),
7391
+ node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise: diag(6932, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise_6932", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'none' otherwise."),
7392
+ node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise: diag(6933, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise_6933", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'babel' otherwise."),
7388
7393
  Variable_0_implicitly_has_an_1_type: diag(7005, 1 /* Error */, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
7389
7394
  Parameter_0_implicitly_has_an_1_type: diag(7006, 1 /* Error */, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
7390
7395
  Member_0_implicitly_has_an_1_type: diag(7008, 1 /* Error */, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
@@ -16359,11 +16364,46 @@ function getEmitScriptTarget(compilerOptions) {
16359
16364
  return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
16360
16365
  }
16361
16366
  function getEmitModuleKind(compilerOptions) {
16367
+ if (typeof compilerOptions.module === "object" && compilerOptions.module.emit !== void 0) {
16368
+ return compilerOptions.module.emit;
16369
+ }
16362
16370
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
16363
16371
  }
16364
16372
  function emitModuleKindIsNonNodeESM(moduleKind) {
16365
16373
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
16366
16374
  }
16375
+ function getModulePreset(compilerOptions) {
16376
+ if (typeof compilerOptions.module === "object") {
16377
+ return compilerOptions.module.preset;
16378
+ }
16379
+ return compilerOptions.module;
16380
+ }
16381
+ function getModuleFormatDetectionKind(compilerOptions) {
16382
+ if (typeof compilerOptions.module === "object" && compilerOptions.module.formatDetection !== void 0) {
16383
+ return compilerOptions.module.formatDetection;
16384
+ }
16385
+ switch (getModulePreset(compilerOptions)) {
16386
+ case 100 /* Node16 */:
16387
+ return 100 /* Node16 */;
16388
+ case 199 /* NodeNext */:
16389
+ return 199 /* NodeNext */;
16390
+ default:
16391
+ return 0 /* None */;
16392
+ }
16393
+ }
16394
+ function getModuleFormatInteropKind(compilerOptions) {
16395
+ if (typeof compilerOptions.module === "object" && compilerOptions.module.formatInterop !== void 0) {
16396
+ return compilerOptions.module.formatInterop;
16397
+ }
16398
+ switch (getModulePreset(compilerOptions)) {
16399
+ case 100 /* Node16 */:
16400
+ return 100 /* Node16 */;
16401
+ case 199 /* NodeNext */:
16402
+ return 199 /* NodeNext */;
16403
+ default:
16404
+ return 1 /* Babel */;
16405
+ }
16406
+ }
16367
16407
  function getEmitModuleResolutionKind(compilerOptions) {
16368
16408
  let moduleResolution = compilerOptions.moduleResolution;
16369
16409
  if (moduleResolution === void 0) {
@@ -34194,23 +34234,79 @@ var targetOptionDeclaration = {
34194
34234
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
34195
34235
  defaultValueDescription: 1 /* ES5 */
34196
34236
  };
34237
+ var moduleKindMap = new Map(Object.entries({
34238
+ none: 0 /* None */,
34239
+ commonjs: 1 /* CommonJS */,
34240
+ amd: 2 /* AMD */,
34241
+ system: 4 /* System */,
34242
+ umd: 3 /* UMD */,
34243
+ es6: 5 /* ES2015 */,
34244
+ es2015: 5 /* ES2015 */,
34245
+ es2020: 6 /* ES2020 */,
34246
+ es2022: 7 /* ES2022 */,
34247
+ esnext: 99 /* ESNext */,
34248
+ node16: 100 /* Node16 */,
34249
+ nodenext: 199 /* NodeNext */
34250
+ }));
34251
+ var moduleSubOptionDeclarations = [
34252
+ {
34253
+ name: "preset",
34254
+ type: moduleKindMap,
34255
+ affectsSourceFile: true,
34256
+ affectsBuildInfo: true,
34257
+ affectsEmit: true,
34258
+ affectsSemanticDiagnostics: true,
34259
+ category: Diagnostics.Modules,
34260
+ description: Diagnostics.Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers,
34261
+ defaultValueDescription: void 0,
34262
+ getParentOption: getModuleOptionDeclaration
34263
+ },
34264
+ {
34265
+ name: "formatDetection",
34266
+ type: new Map(Object.entries({
34267
+ none: 0 /* None */,
34268
+ bundler: 1 /* Bundler */,
34269
+ node16: 100 /* Node16 */,
34270
+ nodenext: 199 /* NodeNext */
34271
+ })),
34272
+ affectsModuleResolution: true,
34273
+ affectsSemanticDiagnostics: true,
34274
+ affectsEmit: true,
34275
+ category: Diagnostics.Modules,
34276
+ description: Diagnostics.Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules,
34277
+ defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise,
34278
+ getParentOption: getModuleOptionDeclaration
34279
+ },
34280
+ {
34281
+ name: "formatInterop",
34282
+ type: new Map(Object.entries({
34283
+ babel: 1 /* Babel */,
34284
+ bundlernode: 2 /* BundlerNode */,
34285
+ node16: 100 /* Node16 */,
34286
+ nodenext: 199 /* NodeNext */
34287
+ })),
34288
+ affectsSemanticDiagnostics: true,
34289
+ category: Diagnostics.Modules,
34290
+ description: Diagnostics.Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation,
34291
+ defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise,
34292
+ getParentOption: getModuleOptionDeclaration
34293
+ },
34294
+ {
34295
+ name: "emit",
34296
+ type: moduleKindMap,
34297
+ affectsEmit: true,
34298
+ category: Diagnostics.Modules,
34299
+ description: Diagnostics.Specify_what_module_code_is_generated,
34300
+ defaultValueDescription: void 0,
34301
+ getParentOption: getModuleOptionDeclaration
34302
+ }
34303
+ ];
34197
34304
  var moduleOptionDeclaration = {
34198
34305
  name: "module",
34199
34306
  shortName: "m",
34200
- type: new Map(Object.entries({
34201
- none: 0 /* None */,
34202
- commonjs: 1 /* CommonJS */,
34203
- amd: 2 /* AMD */,
34204
- system: 4 /* System */,
34205
- umd: 3 /* UMD */,
34206
- es6: 5 /* ES2015 */,
34207
- es2015: 5 /* ES2015 */,
34208
- es2020: 6 /* ES2020 */,
34209
- es2022: 7 /* ES2022 */,
34210
- esnext: 99 /* ESNext */,
34211
- node16: 100 /* Node16 */,
34212
- nodenext: 199 /* NodeNext */
34213
- })),
34307
+ type: "objectOrShorthand",
34308
+ shorthandType: moduleKindMap,
34309
+ elementOptions: commandLineOptionsToMap(moduleSubOptionDeclarations),
34214
34310
  affectsSourceFile: true,
34215
34311
  affectsModuleResolution: true,
34216
34312
  affectsEmit: true,
@@ -34221,6 +34317,9 @@ var moduleOptionDeclaration = {
34221
34317
  description: Diagnostics.Specify_what_module_code_is_generated,
34222
34318
  defaultValueDescription: void 0
34223
34319
  };
34320
+ function getModuleOptionDeclaration() {
34321
+ return moduleOptionDeclaration;
34322
+ }
34224
34323
  var commandOptionsWithoutBuild = [
34225
34324
  // CommandLine only options
34226
34325
  {
@@ -34287,6 +34386,9 @@ var commandOptionsWithoutBuild = [
34287
34386
  // Basic
34288
34387
  targetOptionDeclaration,
34289
34388
  moduleOptionDeclaration,
34389
+ // HEAD
34390
+ //
34391
+ // parent of 19e60f1a19 (Fix showConfig)
34290
34392
  {
34291
34393
  name: "lib",
34292
34394
  type: "list",
@@ -35283,10 +35385,16 @@ function createOptionNameMap(optionDeclarations2) {
35283
35385
  const optionsNameMap = /* @__PURE__ */ new Map();
35284
35386
  const shortOptionNames = /* @__PURE__ */ new Map();
35285
35387
  forEach(optionDeclarations2, (option) => {
35286
- optionsNameMap.set(option.name.toLowerCase(), option);
35388
+ const lowerCaseName = option.name.toLowerCase();
35389
+ optionsNameMap.set(lowerCaseName, option);
35287
35390
  if (option.shortName) {
35288
35391
  shortOptionNames.set(option.shortName, option.name);
35289
35392
  }
35393
+ if (option.type === "objectOrShorthand") {
35394
+ forEachEntry(option.elementOptions, (subOption, subOptionName) => {
35395
+ optionsNameMap.set(`${lowerCaseName}.${subOptionName.toLowerCase()}`, subOption);
35396
+ });
35397
+ }
35290
35398
  });
35291
35399
  return { optionsNameMap, shortOptionNames };
35292
35400
  }
@@ -35307,7 +35415,8 @@ var defaultInitCompilerOptions = {
35307
35415
  skipLibCheck: true
35308
35416
  };
35309
35417
  function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
35310
- const namesOfType = arrayFrom(opt.type.keys());
35418
+ const type = opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type;
35419
+ const namesOfType = arrayFrom(type.keys());
35311
35420
  const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
35312
35421
  return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
35313
35422
  }
@@ -35430,6 +35539,7 @@ function parseCommandLineWorker(diagnostics, commandLine, readFile) {
35430
35539
  }
35431
35540
  }
35432
35541
  function parseOptionValue(args, i, diagnostics, opt, options, errors) {
35542
+ var _a;
35433
35543
  if (opt.isTSConfigOnly) {
35434
35544
  const optValue = args[i];
35435
35545
  if (optValue === "null") {
@@ -35458,40 +35568,46 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
35458
35568
  if (!args[i] && opt.type !== "boolean") {
35459
35569
  errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));
35460
35570
  }
35571
+ const parentOption = (_a = opt.getParentOption) == null ? void 0 : _a.call(opt);
35572
+ const [base = {}, name] = parentOption ? [options[parentOption.name], opt.name] : [options, opt.name];
35573
+ if (parentOption) {
35574
+ options[parentOption.name] = base;
35575
+ }
35461
35576
  if (args[i] !== "null") {
35462
- switch (opt.type) {
35577
+ switch (opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type) {
35463
35578
  case "number":
35464
- options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);
35579
+ base[name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);
35465
35580
  i++;
35466
35581
  break;
35467
35582
  case "boolean":
35468
35583
  const optValue = args[i];
35469
- options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors);
35584
+ base[name] = validateJsonOptionValue(opt, optValue !== "false", errors);
35470
35585
  if (optValue === "false" || optValue === "true") {
35471
35586
  i++;
35472
35587
  }
35473
35588
  break;
35474
35589
  case "string":
35475
- options[opt.name] = validateJsonOptionValue(opt, args[i] || "", errors);
35590
+ base[name] = validateJsonOptionValue(opt, args[i] || "", errors);
35476
35591
  i++;
35477
35592
  break;
35478
35593
  case "list":
35479
35594
  const result = parseListTypeOption(opt, args[i], errors);
35480
- options[opt.name] = result || [];
35595
+ base[name] = result || [];
35481
35596
  if (result) {
35482
35597
  i++;
35483
35598
  }
35484
35599
  break;
35600
+ case "object":
35485
35601
  case "listOrElement":
35486
- Debug.fail("listOrElement not supported here");
35602
+ Debug.fail("listOrElement, object, and objectOrShorthand not supported here");
35487
35603
  break;
35488
35604
  default:
35489
- options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
35605
+ base[name] = parseCustomTypeOption(opt, args[i], errors);
35490
35606
  i++;
35491
35607
  break;
35492
35608
  }
35493
35609
  } else {
35494
- options[opt.name] = void 0;
35610
+ base[name] = void 0;
35495
35611
  i++;
35496
35612
  }
35497
35613
  }
@@ -35857,17 +35973,23 @@ function isCompilerOptionsValue(option, value) {
35857
35973
  if (option) {
35858
35974
  if (isNullOrUndefined(value))
35859
35975
  return !option.disallowNullOrUndefined;
35860
- if (option.type === "list") {
35861
- return isArray(value);
35862
- }
35863
35976
  if (option.type === "listOrElement") {
35864
- return isArray(value) || isCompilerOptionsValue(option.element, value);
35977
+ return isCompilerOptionsValueWorker("list", value) || isCompilerOptionsValue(option.element, value);
35865
35978
  }
35866
- const expectedType = isString(option.type) ? option.type : "string";
35867
- return typeof value === expectedType;
35979
+ if (option.type === "objectOrShorthand") {
35980
+ return isCompilerOptionsValueWorker(option.shorthandType, value) || typeof value === "object";
35981
+ }
35982
+ return isCompilerOptionsValueWorker(option.type, value);
35868
35983
  }
35869
35984
  return false;
35870
35985
  }
35986
+ function isCompilerOptionsValueWorker(type, value) {
35987
+ if (type === "list") {
35988
+ return isArray(value);
35989
+ }
35990
+ const expectedType = isString(type) ? type : "string";
35991
+ return typeof value === expectedType;
35992
+ }
35871
35993
  function convertToTSConfig(configParseResult, configFileName, host) {
35872
35994
  var _a, _b, _c;
35873
35995
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
@@ -35951,6 +36073,8 @@ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
35951
36073
  case "list":
35952
36074
  case "listOrElement":
35953
36075
  return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
36076
+ case "objectOrShorthand":
36077
+ return typeof optionDefinition.shorthandType === "object" ? optionDefinition.shorthandType : void 0;
35954
36078
  default:
35955
36079
  return optionDefinition.type;
35956
36080
  }
@@ -36449,6 +36573,7 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
36449
36573
  const options = getDefaultCompilerOptions(configFileName);
36450
36574
  let typeAcquisition;
36451
36575
  let watchOptions;
36576
+ let moduleOption;
36452
36577
  let extendedConfigPath;
36453
36578
  let rootCompilerOptions;
36454
36579
  const rootOptions = getTsconfigRootOptionsMap();
@@ -36476,6 +36601,8 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
36476
36601
  currentOption = watchOptions ?? (watchOptions = {});
36477
36602
  else if (parentOption === typeAcquisitionDeclaration)
36478
36603
  currentOption = typeAcquisition ?? (typeAcquisition = getDefaultTypeAcquisition(configFileName));
36604
+ else if (parentOption === moduleOptionDeclaration)
36605
+ currentOption = moduleOption ?? (moduleOption = {});
36479
36606
  else
36480
36607
  Debug.fail("Unknown option");
36481
36608
  currentOption[option.name] = value;
@@ -36637,6 +36764,16 @@ function convertJsonOption(opt, value, basePath, errors, propertyAssignment, val
36637
36764
  return convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
36638
36765
  } else if (optType === "listOrElement") {
36639
36766
  return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
36767
+ } else if (optType === "objectOrShorthand") {
36768
+ if (!value || typeof value !== "object") {
36769
+ if (!isString(opt.shorthandType)) {
36770
+ return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
36771
+ }
36772
+ const validatedValue2 = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile);
36773
+ return isNullOrUndefined(validatedValue2) ? validatedValue2 : normalizeNonListOptionValue(opt, basePath, validatedValue2);
36774
+ } else {
36775
+ return {};
36776
+ }
36640
36777
  } else if (!isString(opt.type)) {
36641
36778
  return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
36642
36779
  }
@@ -36669,7 +36806,8 @@ function convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sour
36669
36806
  if (isNullOrUndefined(value))
36670
36807
  return void 0;
36671
36808
  const key = value.toLowerCase();
36672
- const val = opt.type.get(key);
36809
+ const type = opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type;
36810
+ const val = type.get(key);
36673
36811
  if (val !== void 0) {
36674
36812
  return validateJsonOptionValue(opt, val, errors, valueExpression, sourceFile);
36675
36813
  } else {
@@ -36896,7 +37034,8 @@ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, exte
36896
37034
  }
36897
37035
  }
36898
37036
  function getDefaultValueForOption(option) {
36899
- switch (option.type) {
37037
+ const type = option.type === "objectOrShorthand" ? option.shorthandType : option.type;
37038
+ switch (type) {
36900
37039
  case "number":
36901
37040
  return 1;
36902
37041
  case "boolean":
@@ -45633,19 +45772,16 @@ function createTypeChecker(host) {
45633
45772
  return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
45634
45773
  }
45635
45774
  function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
45636
- return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
45775
+ return usageMode === 99 /* ESNext */ && targetMode !== 99 /* ESNext */;
45637
45776
  }
45638
45777
  function isOnlyImportedAsDefault(usage) {
45639
45778
  const usageMode = getUsageModeForExpression(usage);
45640
45779
  return usageMode === 99 /* ESNext */ && endsWith(usage.text, ".json" /* Json */);
45641
45780
  }
45642
45781
  function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
45643
- const usageMode = file && getUsageModeForExpression(usage);
45644
- if (file && usageMode !== void 0) {
45645
- const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
45646
- if (usageMode === 99 /* ESNext */ || result) {
45647
- return result;
45648
- }
45782
+ const usageMode = file && getModuleFormatInteropKind(compilerOptions) !== 1 /* Babel */ && getUsageModeForExpression(usage);
45783
+ if (usageMode === 99 /* ESNext */) {
45784
+ return isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
45649
45785
  }
45650
45786
  if (!allowSyntheticDefaultImports) {
45651
45787
  return false;
@@ -46538,6 +46674,7 @@ function createTypeChecker(host) {
46538
46674
  const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
46539
46675
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
46540
46676
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
46677
+ const moduleFormatInterop = getModuleFormatInteropKind(compilerOptions);
46541
46678
  const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
46542
46679
  const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
46543
46680
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
@@ -46573,7 +46710,7 @@ function createTypeChecker(host) {
46573
46710
  moduleReference
46574
46711
  );
46575
46712
  }
46576
- if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
46713
+ if (moduleFormatInterop === 100 /* Node16 */ || moduleFormatInterop === 199 /* NodeNext */) {
46577
46714
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
46578
46715
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
46579
46716
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
@@ -107347,7 +107484,7 @@ function transformECMAScriptModule(context) {
107347
107484
  return node.isExportEquals ? void 0 : node;
107348
107485
  }
107349
107486
  function visitExportDeclaration(node) {
107350
- if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
107487
+ if (getEmitModuleKind(compilerOptions) > 5 /* ES2015 */) {
107351
107488
  return node;
107352
107489
  }
107353
107490
  if (!node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {
@@ -116537,20 +116674,25 @@ function getConfigFileParsingDiagnostics(configFileParseResult) {
116537
116674
  return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors;
116538
116675
  }
116539
116676
  function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
116540
- switch (getEmitModuleResolutionKind(options)) {
116541
- case 3 /* Node16 */:
116542
- case 99 /* NodeNext */:
116543
- return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
116677
+ const formatDetection = getModuleFormatDetectionKind(options);
116678
+ switch (formatDetection) {
116679
+ case 1 /* Bundler */:
116680
+ case 100 /* Node16 */:
116681
+ case 199 /* NodeNext */:
116682
+ case 2 /* DefaultModule */:
116683
+ case 3 /* DefaultCommonJS */:
116684
+ const defaultFormat = formatDetection === 1 /* Bundler */ ? void 0 : formatDetection === 2 /* DefaultModule */ ? 99 /* ESNext */ : 1 /* CommonJS */;
116685
+ return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson(defaultFormat) : void 0;
116544
116686
  default:
116545
116687
  return void 0;
116546
116688
  }
116547
- function lookupFromPackageJson() {
116689
+ function lookupFromPackageJson(defaultFormat) {
116548
116690
  const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
116549
116691
  const packageJsonLocations = [];
116550
116692
  state.failedLookupLocations = packageJsonLocations;
116551
116693
  state.affectingLocations = packageJsonLocations;
116552
116694
  const packageJsonScope = getPackageScopeForPath(fileName, state);
116553
- const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : 1 /* CommonJS */;
116695
+ const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "commonjs" ? 1 /* CommonJS */ : defaultFormat;
116554
116696
  return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
116555
116697
  }
116556
116698
  }
@@ -126329,11 +126471,12 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
126329
126471
  }
126330
126472
  function getPossibleValues(option3) {
126331
126473
  let possibleValues;
126332
- switch (option3.type) {
126474
+ const type = option3.type === "objectOrShorthand" ? option3.shorthandType : option3.type;
126475
+ switch (type) {
126333
126476
  case "string":
126334
126477
  case "number":
126335
126478
  case "boolean":
126336
- possibleValues = option3.type;
126479
+ possibleValues = type;
126337
126480
  break;
126338
126481
  case "list":
126339
126482
  case "listOrElement":
@@ -126344,7 +126487,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
126344
126487
  break;
126345
126488
  default:
126346
126489
  const inverted = {};
126347
- option3.type.forEach((value, name2) => {
126490
+ type.forEach((value, name2) => {
126348
126491
  var _a2;
126349
126492
  if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) {
126350
126493
  (inverted[value] || (inverted[value] = [])).push(name2);