@formatjs/cli 6.6.3 → 6.6.4

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.
Files changed (2) hide show
  1. package/bin/formatjs +1029 -572
  2. package/package.json +2 -2
package/bin/formatjs CHANGED
@@ -18547,9 +18547,9 @@ var init_compile_folder = __esm({
18547
18547
  }
18548
18548
  });
18549
18549
 
18550
- // node_modules/.aspect_rules_js/typescript@5.7.3/node_modules/typescript/lib/typescript.js
18550
+ // node_modules/.aspect_rules_js/typescript@5.8.2/node_modules/typescript/lib/typescript.js
18551
18551
  var require_typescript = __commonJS({
18552
- "node_modules/.aspect_rules_js/typescript@5.7.3/node_modules/typescript/lib/typescript.js"(exports, module2) {
18552
+ "node_modules/.aspect_rules_js/typescript@5.8.2/node_modules/typescript/lib/typescript.js"(exports, module2) {
18553
18553
  var ts2 = {};
18554
18554
  ((module3) => {
18555
18555
  "use strict";
@@ -18972,6 +18972,7 @@ var require_typescript = __commonJS({
18972
18972
  createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
18973
18973
  createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
18974
18974
  createProgram: () => createProgram,
18975
+ createProgramDiagnostics: () => createProgramDiagnostics,
18975
18976
  createProgramHost: () => createProgramHost,
18976
18977
  createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
18977
18978
  createQueue: () => createQueue,
@@ -19141,6 +19142,8 @@ var require_typescript = __commonJS({
19141
19142
  forEachLeadingCommentRange: () => forEachLeadingCommentRange,
19142
19143
  forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
19143
19144
  forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
19145
+ forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
19146
+ forEachProjectReference: () => forEachProjectReference,
19144
19147
  forEachPropertyAssignment: () => forEachPropertyAssignment,
19145
19148
  forEachResolvedProjectReference: () => forEachResolvedProjectReference,
19146
19149
  forEachReturnStatement: () => forEachReturnStatement,
@@ -19380,6 +19383,8 @@ var require_typescript = __commonJS({
19380
19383
  getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
19381
19384
  getLeftmostAccessExpression: () => getLeftmostAccessExpression,
19382
19385
  getLeftmostExpression: () => getLeftmostExpression,
19386
+ getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
19387
+ getLibNameFromLibReference: () => getLibNameFromLibReference,
19383
19388
  getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
19384
19389
  getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
19385
19390
  getLineInfo: () => getLineInfo,
@@ -19452,6 +19457,8 @@ var require_typescript = __commonJS({
19452
19457
  getOptionFromName: () => getOptionFromName,
19453
19458
  getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
19454
19459
  getOptionsNameMap: () => getOptionsNameMap,
19460
+ getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
19461
+ getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
19455
19462
  getOrCreateEmitNode: () => getOrCreateEmitNode,
19456
19463
  getOrUpdate: () => getOrUpdate,
19457
19464
  getOriginalNode: () => getOriginalNode,
@@ -19488,7 +19495,6 @@ var require_typescript = __commonJS({
19488
19495
  getPrivateIdentifier: () => getPrivateIdentifier,
19489
19496
  getProperties: () => getProperties,
19490
19497
  getProperty: () => getProperty,
19491
- getPropertyArrayElementValue: () => getPropertyArrayElementValue,
19492
19498
  getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
19493
19499
  getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
19494
19500
  getPropertyNameFromType: () => getPropertyNameFromType,
@@ -20399,6 +20405,7 @@ var require_typescript = __commonJS({
20399
20405
  moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
20400
20406
  moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
20401
20407
  moduleSpecifiers: () => ts_moduleSpecifiers_exports,
20408
+ moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
20402
20409
  moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
20403
20410
  moveEmitHelpers: () => moveEmitHelpers,
20404
20411
  moveRangeEnd: () => moveRangeEnd,
@@ -20811,8 +20818,8 @@ var require_typescript = __commonJS({
20811
20818
  zipWith: () => zipWith
20812
20819
  });
20813
20820
  module3.exports = __toCommonJS2(typescript_exports);
20814
- var versionMajorMinor = "5.7";
20815
- var version = "5.7.3";
20821
+ var versionMajorMinor = "5.8";
20822
+ var version = "5.8.2";
20816
20823
  var Comparison = ((Comparison3) => {
20817
20824
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
20818
20825
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -25499,6 +25506,7 @@ ${lanes.join("\n")}
25499
25506
  ModuleKind3[ModuleKind3["ES2022"] = 7] = "ES2022";
25500
25507
  ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext";
25501
25508
  ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16";
25509
+ ModuleKind3[ModuleKind3["Node18"] = 101] = "Node18";
25502
25510
  ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext";
25503
25511
  ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve";
25504
25512
  return ModuleKind3;
@@ -25983,8 +25991,9 @@ ${lanes.join("\n")}
25983
25991
  OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions";
25984
25992
  OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
25985
25993
  OuterExpressionKinds2[OuterExpressionKinds2["ExpressionsWithTypeArguments"] = 16] = "ExpressionsWithTypeArguments";
25986
- OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 6] = "Assertions";
25987
- OuterExpressionKinds2[OuterExpressionKinds2["All"] = 31] = "All";
25994
+ OuterExpressionKinds2[OuterExpressionKinds2["Satisfies"] = 32] = "Satisfies";
25995
+ OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 38] = "Assertions";
25996
+ OuterExpressionKinds2[OuterExpressionKinds2["All"] = 63] = "All";
25988
25997
  OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = -2147483648] = "ExcludeJSDocTypeAssertion";
25989
25998
  return OuterExpressionKinds2;
25990
25999
  })(OuterExpressionKinds || {});
@@ -27839,23 +27848,105 @@ ${lanes.join("\n")}
27839
27848
  function getNormalizedPathComponents(path, currentDirectory) {
27840
27849
  return reducePathComponents(getPathComponents(path, currentDirectory));
27841
27850
  }
27842
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
27843
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
27851
+ function getNormalizedAbsolutePath(path, currentDirectory) {
27852
+ let rootLength = getRootLength(path);
27853
+ if (rootLength === 0 && currentDirectory) {
27854
+ path = combinePaths(currentDirectory, path);
27855
+ rootLength = getRootLength(path);
27856
+ } else {
27857
+ path = normalizeSlashes(path);
27858
+ }
27859
+ const simpleNormalized = simpleNormalizePath(path);
27860
+ if (simpleNormalized !== void 0) {
27861
+ return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
27862
+ }
27863
+ const length2 = path.length;
27864
+ const root = path.substring(0, rootLength);
27865
+ let normalized;
27866
+ let index = rootLength;
27867
+ let segmentStart = index;
27868
+ let normalizedUpTo = index;
27869
+ let seenNonDotDotSegment = rootLength !== 0;
27870
+ while (index < length2) {
27871
+ segmentStart = index;
27872
+ let ch = path.charCodeAt(index);
27873
+ while (ch === 47 && index + 1 < length2) {
27874
+ index++;
27875
+ ch = path.charCodeAt(index);
27876
+ }
27877
+ if (index > segmentStart) {
27878
+ normalized ?? (normalized = path.substring(0, segmentStart - 1));
27879
+ segmentStart = index;
27880
+ }
27881
+ let segmentEnd = path.indexOf(directorySeparator, index + 1);
27882
+ if (segmentEnd === -1) {
27883
+ segmentEnd = length2;
27884
+ }
27885
+ const segmentLength = segmentEnd - segmentStart;
27886
+ if (segmentLength === 1 && path.charCodeAt(index) === 46) {
27887
+ normalized ?? (normalized = path.substring(0, normalizedUpTo));
27888
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 && path.charCodeAt(index + 1) === 46) {
27889
+ if (!seenNonDotDotSegment) {
27890
+ if (normalized !== void 0) {
27891
+ normalized += normalized.length === rootLength ? ".." : "/..";
27892
+ } else {
27893
+ normalizedUpTo = index + 2;
27894
+ }
27895
+ } else if (normalized === void 0) {
27896
+ if (normalizedUpTo - 2 >= 0) {
27897
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
27898
+ } else {
27899
+ normalized = path.substring(0, normalizedUpTo);
27900
+ }
27901
+ } else {
27902
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
27903
+ if (lastSlash !== -1) {
27904
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
27905
+ } else {
27906
+ normalized = root;
27907
+ }
27908
+ if (normalized.length === rootLength) {
27909
+ seenNonDotDotSegment = rootLength !== 0;
27910
+ }
27911
+ }
27912
+ } else if (normalized !== void 0) {
27913
+ if (normalized.length !== rootLength) {
27914
+ normalized += directorySeparator;
27915
+ }
27916
+ seenNonDotDotSegment = true;
27917
+ normalized += path.substring(segmentStart, segmentEnd);
27918
+ } else {
27919
+ seenNonDotDotSegment = true;
27920
+ normalizedUpTo = segmentEnd;
27921
+ }
27922
+ index = segmentEnd + 1;
27923
+ }
27924
+ return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path) : path);
27844
27925
  }
27845
27926
  function normalizePath(path) {
27846
27927
  path = normalizeSlashes(path);
27928
+ let normalized = simpleNormalizePath(path);
27929
+ if (normalized !== void 0) {
27930
+ return normalized;
27931
+ }
27932
+ normalized = getNormalizedAbsolutePath(path, "");
27933
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
27934
+ }
27935
+ function simpleNormalizePath(path) {
27847
27936
  if (!relativePathSegmentRegExp.test(path)) {
27848
27937
  return path;
27849
27938
  }
27850
- const simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
27939
+ let simplified = path.replace(/\/\.\//g, "/");
27940
+ if (simplified.startsWith("./")) {
27941
+ simplified = simplified.slice(2);
27942
+ }
27851
27943
  if (simplified !== path) {
27852
27944
  path = simplified;
27853
27945
  if (!relativePathSegmentRegExp.test(path)) {
27854
27946
  return path;
27855
27947
  }
27856
27948
  }
27857
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
27858
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
27949
+ return void 0;
27859
27950
  }
27860
27951
  function getPathWithoutRoot(pathComponents2) {
27861
27952
  if (pathComponents2.length === 0)
@@ -28288,6 +28379,7 @@ ${lanes.join("\n")}
28288
28379
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
28289
28380
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
28290
28381
  ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
28382
+ This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
28291
28383
  with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
28292
28384
  await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
28293
28385
  The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
@@ -28302,8 +28394,8 @@ ${lanes.join("\n")}
28302
28394
  Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
28303
28395
  Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
28304
28396
  Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
28305
- Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
28306
- Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve: diag(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodene_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'."),
28397
+ Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."),
28398
+ Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."),
28307
28399
  Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
28308
28400
  This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
28309
28401
  String_literal_with_double_quotes_expected: diag(1327, 1, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
@@ -28320,7 +28412,7 @@ ${lanes.join("\n")}
28320
28412
  Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
28321
28413
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
28322
28414
  Class_constructor_may_not_be_an_accessor: diag(1341, 1, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
28323
- The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
28415
+ The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."),
28324
28416
  A_label_is_not_allowed_here: diag(1344, 1, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
28325
28417
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
28326
28418
  This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
@@ -28350,7 +28442,7 @@ ${lanes.join("\n")}
28350
28442
  await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
28351
28443
  _0_was_imported_here: diag(1376, 3, "_0_was_imported_here_1376", "'{0}' was imported here."),
28352
28444
  _0_was_exported_here: diag(1377, 3, "_0_was_exported_here_1377", "'{0}' was exported here."),
28353
- Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
28445
+ Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
28354
28446
  An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
28355
28447
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
28356
28448
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `&rbrace;`?"),
@@ -28401,7 +28493,7 @@ ${lanes.join("\n")}
28401
28493
  File_redirects_to_file_0: diag(1429, 3, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
28402
28494
  The_file_is_in_the_program_because_Colon: diag(1430, 3, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
28403
28495
  for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
28404
- Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
28496
+ Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
28405
28497
  Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
28406
28498
  Unexpected_keyword_or_identifier: diag(1434, 1, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
28407
28499
  Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
@@ -29043,9 +29135,9 @@ ${lanes.join("\n")}
29043
29135
  Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
29044
29136
  Namespace_name_cannot_be_0: diag(2819, 1, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
29045
29137
  Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
29046
- Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
29138
+ Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
29047
29139
  Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
29048
- Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
29140
+ Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
29049
29141
  Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
29050
29142
  Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
29051
29143
  Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
@@ -29065,7 +29157,7 @@ ${lanes.join("\n")}
29065
29157
  The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
29066
29158
  await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
29067
29159
  await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
29068
- Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
29160
+ Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
29069
29161
  Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
29070
29162
  Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
29071
29163
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
@@ -29091,6 +29183,7 @@ ${lanes.join("\n")}
29091
29183
  This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
29092
29184
  This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
29093
29185
  Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
29186
+ Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
29094
29187
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
29095
29188
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
29096
29189
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -29200,6 +29293,8 @@ ${lanes.join("\n")}
29200
29293
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
29201
29294
  Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
29202
29295
  One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
29296
+ This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
29297
+ This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
29203
29298
  The_current_host_does_not_support_the_0_option: diag(5001, 1, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
29204
29299
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
29205
29300
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -29772,11 +29867,13 @@ ${lanes.join("\n")}
29772
29867
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3, "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."),
29773
29868
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
29774
29869
  Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
29870
+ Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
29775
29871
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
29776
29872
  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, "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."),
29777
29873
  Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
29778
29874
  Check_side_effect_imports: diag(6806, 3, "Check_side_effect_imports_6806", "Check side effect imports."),
29779
29875
  This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
29876
+ Enable_lib_replacement: diag(6808, 3, "Enable_lib_replacement_6808", "Enable lib replacement."),
29780
29877
  one_of_Colon: diag(6900, 3, "one_of_Colon_6900", "one of:"),
29781
29878
  one_or_more_Colon: diag(6901, 3, "one_or_more_Colon_6901", "one or more:"),
29782
29879
  type_Colon: diag(6902, 3, "type_Colon_6902", "type:"),
@@ -35870,6 +35967,9 @@ ${lanes.join("\n")}
35870
35967
  "trunc",
35871
35968
  "fround",
35872
35969
  "cbrt"
35970
+ ],
35971
+ esnext: [
35972
+ "f16round"
35873
35973
  ]
35874
35974
  })),
35875
35975
  Map: new Map(Object.entries({
@@ -36039,6 +36139,10 @@ ${lanes.join("\n")}
36039
36139
  "setBigUint64",
36040
36140
  "getBigInt64",
36041
36141
  "getBigUint64"
36142
+ ],
36143
+ esnext: [
36144
+ "setFloat16",
36145
+ "getFloat16"
36042
36146
  ]
36043
36147
  })),
36044
36148
  BigInt: new Map(Object.entries({
@@ -36142,6 +36246,9 @@ ${lanes.join("\n")}
36142
36246
  "with"
36143
36247
  ]
36144
36248
  })),
36249
+ Float16Array: new Map(Object.entries({
36250
+ esnext: emptyArray
36251
+ })),
36145
36252
  Float32Array: new Map(Object.entries({
36146
36253
  es2022: [
36147
36254
  "at"
@@ -36333,7 +36440,7 @@ ${lanes.join("\n")}
36333
36440
  return (_a = symbol.declarations) == null ? void 0 : _a.find((d) => !isExternalModuleAugmentation(d) && !(isModuleDeclaration(d) && isGlobalScopeAugmentation(d)));
36334
36441
  }
36335
36442
  function isCommonJSContainingModuleKind(kind) {
36336
- return kind === 1 || kind === 100 || kind === 199;
36443
+ return kind === 1 || 100 <= kind && kind <= 199;
36337
36444
  }
36338
36445
  function isEffectiveExternalModule(node, compilerOptions) {
36339
36446
  return isExternalModule(node) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator;
@@ -37054,9 +37161,6 @@ ${lanes.join("\n")}
37054
37161
  return key === propName || key2 && key2 === propName ? callback(property) : void 0;
37055
37162
  });
37056
37163
  }
37057
- function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
37058
- return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
37059
- }
37060
37164
  function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
37061
37165
  if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
37062
37166
  const expression = tsConfigSourceFile.statements[0].expression;
@@ -41039,7 +41143,7 @@ ${lanes.join("\n")}
41039
41143
  dependencies: ["module"],
41040
41144
  computeValue: (compilerOptions) => {
41041
41145
  const target = compilerOptions.target === 0 ? void 0 : compilerOptions.target;
41042
- return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 199 && 99 || 1);
41146
+ return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 101 && 9 || compilerOptions.module === 199 && 99 || 1);
41043
41147
  }
41044
41148
  },
41045
41149
  module: {
@@ -41058,6 +41162,7 @@ ${lanes.join("\n")}
41058
41162
  moduleResolution = 2;
41059
41163
  break;
41060
41164
  case 100:
41165
+ case 101:
41061
41166
  moduleResolution = 3;
41062
41167
  break;
41063
41168
  case 199:
@@ -41077,7 +41182,11 @@ ${lanes.join("\n")}
41077
41182
  moduleDetection: {
41078
41183
  dependencies: ["module", "target"],
41079
41184
  computeValue: (compilerOptions) => {
41080
- return compilerOptions.moduleDetection || (_computedOptions.module.computeValue(compilerOptions) === 100 || _computedOptions.module.computeValue(compilerOptions) === 199 ? 3 : 2);
41185
+ if (compilerOptions.moduleDetection !== void 0) {
41186
+ return compilerOptions.moduleDetection;
41187
+ }
41188
+ const moduleKind = _computedOptions.module.computeValue(compilerOptions);
41189
+ return 100 <= moduleKind && moduleKind <= 199 ? 3 : 2;
41081
41190
  }
41082
41191
  },
41083
41192
  isolatedModules: {
@@ -41094,6 +41203,7 @@ ${lanes.join("\n")}
41094
41203
  }
41095
41204
  switch (_computedOptions.module.computeValue(compilerOptions)) {
41096
41205
  case 100:
41206
+ case 101:
41097
41207
  case 199:
41098
41208
  case 200:
41099
41209
  return true;
@@ -41287,6 +41397,9 @@ ${lanes.join("\n")}
41287
41397
  function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
41288
41398
  return moduleResolution >= 3 && moduleResolution <= 99 || moduleResolution === 100;
41289
41399
  }
41400
+ function moduleSupportsImportAttributes(moduleKind) {
41401
+ return 101 <= moduleKind && moduleKind <= 199 || moduleKind === 200 || moduleKind === 99;
41402
+ }
41290
41403
  function getStrictOptionValue(compilerOptions, flag) {
41291
41404
  return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
41292
41405
  }
@@ -42143,7 +42256,7 @@ ${lanes.join("\n")}
42143
42256
  return success && result === 10 && scanner2.getTokenEnd() === s.length + 1 && !(flags & 512) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
42144
42257
  }
42145
42258
  function isValidTypeOnlyAliasUseSite(useSite) {
42146
- return !!(useSite.flags & 33554432) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
42259
+ return !!(useSite.flags & 33554432) || isInJSDoc(useSite) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
42147
42260
  }
42148
42261
  function isShorthandPropertyNameUseSite(useSite) {
42149
42262
  return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
@@ -43363,6 +43476,66 @@ ${lanes.join("\n")}
43363
43476
  function isNewScopeNode(node) {
43364
43477
  return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
43365
43478
  }
43479
+ function getLibNameFromLibReference(libReference) {
43480
+ return toFileNameLowerCase(libReference.fileName);
43481
+ }
43482
+ function getLibFileNameFromLibReference(libReference) {
43483
+ const libName = getLibNameFromLibReference(libReference);
43484
+ return libMap.get(libName);
43485
+ }
43486
+ function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
43487
+ return forEachProjectReference(
43488
+ /*projectReferences*/
43489
+ void 0,
43490
+ resolvedProjectReferences,
43491
+ (resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
43492
+ );
43493
+ }
43494
+ function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
43495
+ let seenResolvedRefs;
43496
+ return worker(
43497
+ projectReferences,
43498
+ resolvedProjectReferences,
43499
+ /*parent*/
43500
+ void 0
43501
+ );
43502
+ function worker(projectReferences2, resolvedProjectReferences2, parent2) {
43503
+ if (cbRef) {
43504
+ const result = cbRef(projectReferences2, parent2);
43505
+ if (result)
43506
+ return result;
43507
+ }
43508
+ let skipChildren;
43509
+ return forEach(
43510
+ resolvedProjectReferences2,
43511
+ (resolvedRef, index) => {
43512
+ if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
43513
+ (skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
43514
+ return void 0;
43515
+ }
43516
+ const result = cbResolvedRef(resolvedRef, parent2, index);
43517
+ if (result || !resolvedRef)
43518
+ return result;
43519
+ (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
43520
+ }
43521
+ ) || forEach(
43522
+ resolvedProjectReferences2,
43523
+ (resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
43524
+ );
43525
+ }
43526
+ }
43527
+ function getOptionsSyntaxByArrayElementValue(optionsObject, name, value) {
43528
+ return optionsObject && getPropertyArrayElementValue(optionsObject, name, value);
43529
+ }
43530
+ function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
43531
+ return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
43532
+ }
43533
+ function getOptionsSyntaxByValue(optionsObject, name, value) {
43534
+ return forEachOptionsSyntaxByName(optionsObject, name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : void 0);
43535
+ }
43536
+ function forEachOptionsSyntaxByName(optionsObject, name, callback) {
43537
+ return forEachPropertyAssignment(optionsObject, name, callback);
43538
+ }
43366
43539
  function createBaseNodeFactory() {
43367
43540
  let NodeConstructor2;
43368
43541
  let TokenConstructor2;
@@ -46503,6 +46676,8 @@ ${lanes.join("\n")}
46503
46676
  );
46504
46677
  node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse);
46505
46678
  node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse);
46679
+ node.flowNodeWhenFalse = void 0;
46680
+ node.flowNodeWhenTrue = void 0;
46506
46681
  return node;
46507
46682
  }
46508
46683
  function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) {
@@ -48620,7 +48795,7 @@ ${lanes.join("\n")}
48620
48795
  function isIgnorableParen(node) {
48621
48796
  return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
48622
48797
  }
48623
- function restoreOuterExpressions(outerExpression, innerExpression, kinds = 31) {
48798
+ function restoreOuterExpressions(outerExpression, innerExpression, kinds = 63) {
48624
48799
  if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
48625
48800
  return updateOuterExpression(
48626
48801
  outerExpression,
@@ -48668,7 +48843,7 @@ ${lanes.join("\n")}
48668
48843
  function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) {
48669
48844
  const callee = skipOuterExpressions(
48670
48845
  expression,
48671
- 31
48846
+ 63
48672
48847
  /* All */
48673
48848
  );
48674
48849
  let thisArg;
@@ -51720,7 +51895,7 @@ ${lanes.join("\n")}
51720
51895
  Debug.assertIsDefined(type);
51721
51896
  return type;
51722
51897
  }
51723
- function isOuterExpression(node, kinds = 31) {
51898
+ function isOuterExpression(node, kinds = 63) {
51724
51899
  switch (node.kind) {
51725
51900
  case 217:
51726
51901
  if (kinds & -2147483648 && isJSDocTypeAssertion(node)) {
@@ -51729,8 +51904,9 @@ ${lanes.join("\n")}
51729
51904
  return (kinds & 1) !== 0;
51730
51905
  case 216:
51731
51906
  case 234:
51732
- case 238:
51733
51907
  return (kinds & 2) !== 0;
51908
+ case 238:
51909
+ return (kinds & (2 | 32)) !== 0;
51734
51910
  case 233:
51735
51911
  return (kinds & 16) !== 0;
51736
51912
  case 235:
@@ -51740,13 +51916,13 @@ ${lanes.join("\n")}
51740
51916
  }
51741
51917
  return false;
51742
51918
  }
51743
- function skipOuterExpressions(node, kinds = 31) {
51919
+ function skipOuterExpressions(node, kinds = 63) {
51744
51920
  while (isOuterExpression(node, kinds)) {
51745
51921
  node = node.expression;
51746
51922
  }
51747
51923
  return node;
51748
51924
  }
51749
- function walkUpOuterExpressions(node, kinds = 31) {
51925
+ function walkUpOuterExpressions(node, kinds = 63) {
51750
51926
  let parent2 = node.parent;
51751
51927
  while (isOuterExpression(parent2, kinds)) {
51752
51928
  parent2 = parent2.parent;
@@ -61084,6 +61260,7 @@ ${lanes.join("\n")}
61084
61260
  const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
61085
61261
  const res = finishNode(node, pos);
61086
61262
  if (usedBrace) {
61263
+ skipWhitespace();
61087
61264
  parseExpected(
61088
61265
  20
61089
61266
  /* CloseBraceToken */
@@ -62185,6 +62362,8 @@ ${lanes.join("\n")}
62185
62362
  ["esnext.regexp", "lib.es2024.regexp.d.ts"],
62186
62363
  ["esnext.string", "lib.es2024.string.d.ts"],
62187
62364
  ["esnext.iterator", "lib.esnext.iterator.d.ts"],
62365
+ ["esnext.promise", "lib.esnext.promise.d.ts"],
62366
+ ["esnext.float16", "lib.esnext.float16.d.ts"],
62188
62367
  ["decorators", "lib.decorators.d.ts"],
62189
62368
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
62190
62369
  ];
@@ -62519,6 +62698,7 @@ ${lanes.join("\n")}
62519
62698
  es2022: 7,
62520
62699
  esnext: 99,
62521
62700
  node16: 100,
62701
+ node18: 101,
62522
62702
  nodenext: 199,
62523
62703
  preserve: 200
62524
62704
  /* Preserve */
@@ -62774,6 +62954,23 @@ ${lanes.join("\n")}
62774
62954
  affectsBuildInfo: true,
62775
62955
  affectsSemanticDiagnostics: true
62776
62956
  },
62957
+ {
62958
+ name: "erasableSyntaxOnly",
62959
+ type: "boolean",
62960
+ category: Diagnostics.Interop_Constraints,
62961
+ description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
62962
+ defaultValueDescription: false,
62963
+ affectsBuildInfo: true,
62964
+ affectsSemanticDiagnostics: true
62965
+ },
62966
+ {
62967
+ name: "libReplacement",
62968
+ type: "boolean",
62969
+ affectsProgramStructure: true,
62970
+ category: Diagnostics.Language_and_Environment,
62971
+ description: Diagnostics.Enable_lib_replacement,
62972
+ defaultValueDescription: true
62973
+ },
62777
62974
  // Strict Type Checks
62778
62975
  {
62779
62976
  name: "strict",
@@ -67126,9 +67323,7 @@ ${lanes.join("\n")}
67126
67323
  }
67127
67324
  function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
67128
67325
  const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
67129
- const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
67130
- const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
67131
- return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
67326
+ return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
67132
67327
  }
67133
67328
  function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
67134
67329
  if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
@@ -67146,8 +67341,7 @@ ${lanes.join("\n")}
67146
67341
  /*onlyRecordFailures*/
67147
67342
  false,
67148
67343
  loadPackageJsonMainState,
67149
- packageJsonInfo.contents.packageJsonContent,
67150
- getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState)
67344
+ packageJsonInfo
67151
67345
  );
67152
67346
  entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path);
67153
67347
  if (features & 8 && packageJsonInfo.contents.packageJsonContent.exports) {
@@ -67366,13 +67560,14 @@ ${lanes.join("\n")}
67366
67560
  (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
67367
67561
  }
67368
67562
  }
67369
- function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
67563
+ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
67564
+ const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
67370
67565
  let packageFile;
67371
- if (jsonContent) {
67566
+ if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
67372
67567
  if (state.isConfigLookup) {
67373
- packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
67568
+ packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
67374
67569
  } else {
67375
- packageFile = extensions & 4 && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 | 4) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
67570
+ packageFile = extensions & 4 && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 | 4) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
67376
67571
  }
67377
67572
  }
67378
67573
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
@@ -67391,7 +67586,7 @@ ${lanes.join("\n")}
67391
67586
  const features = state2.features;
67392
67587
  const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
67393
67588
  state2.candidateIsFromPackageJsonField = true;
67394
- if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
67589
+ if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
67395
67590
  state2.features &= ~32;
67396
67591
  }
67397
67592
  const result = nodeLoadModuleByRelativeName(
@@ -67671,6 +67866,7 @@ ${lanes.join("\n")}
67671
67866
  function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
67672
67867
  return loadModuleFromTargetExportOrImport;
67673
67868
  function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
67869
+ var _a, _b;
67674
67870
  if (typeof target === "string") {
67675
67871
  if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
67676
67872
  if (state.traceEnabled) {
@@ -67699,6 +67895,8 @@ ${lanes.join("\n")}
67699
67895
  redirectedReference,
67700
67896
  state.conditions
67701
67897
  );
67898
+ (_a = state.failedLookupLocations) == null ? void 0 : _a.push(...result.failedLookupLocations ?? emptyArray);
67899
+ (_b = state.affectingLocations) == null ? void 0 : _b.push(...result.affectingLocations ?? emptyArray);
67702
67900
  return toSearchResult(
67703
67901
  result.resolvedModule ? {
67704
67902
  path: result.resolvedModule.resolvedFileName,
@@ -67809,21 +68007,21 @@ ${lanes.join("\n")}
67809
68007
  void 0
67810
68008
  );
67811
68009
  function toAbsolutePath(path) {
67812
- var _a, _b;
68010
+ var _a2, _b2;
67813
68011
  if (path === void 0)
67814
68012
  return path;
67815
- return getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
68013
+ return getNormalizedAbsolutePath(path, (_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2));
67816
68014
  }
67817
68015
  function combineDirectoryPath(root, dir) {
67818
68016
  return ensureTrailingDirectorySeparator(combinePaths(root, dir));
67819
68017
  }
67820
68018
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
67821
- var _a, _b, _c, _d;
68019
+ var _a2, _b2, _c, _d;
67822
68020
  if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
67823
68021
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
67824
68022
  const commonSourceDirGuesses = [];
67825
68023
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
67826
- const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
68024
+ const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "", getCanonicalFileName));
67827
68025
  commonSourceDirGuesses.push(commonDir);
67828
68026
  } else if (state.requestContainingDirectory) {
67829
68027
  const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
@@ -67889,8 +68087,8 @@ ${lanes.join("\n")}
67889
68087
  }
67890
68088
  return void 0;
67891
68089
  function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
67892
- var _a2, _b2;
67893
- const currentDir = state.compilerOptions.configFile ? ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "" : commonSourceDirGuess;
68090
+ var _a3, _b3;
68091
+ const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
67894
68092
  const candidateDirectories = [];
67895
68093
  if (state.compilerOptions.declarationDir) {
67896
68094
  candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
@@ -67940,7 +68138,7 @@ ${lanes.join("\n")}
67940
68138
  );
67941
68139
  }
67942
68140
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
67943
- const mode = state.features === 0 ? void 0 : state.features & 32 ? 99 : 1;
68141
+ const mode = state.features === 0 ? void 0 : state.features & 32 || state.conditions.includes("import") ? 99 : 1;
67944
68142
  const priorityExtensions = extensions & (1 | 4);
67945
68143
  const secondaryExtensions = extensions & ~(1 | 4);
67946
68144
  if (priorityExtensions) {
@@ -68021,8 +68219,7 @@ ${lanes.join("\n")}
68021
68219
  candidate,
68022
68220
  !nodeModulesDirectoryExists,
68023
68221
  state,
68024
- packageInfo.contents.packageJsonContent,
68025
- getVersionPathsOfPackageJsonInfo(packageInfo, state)
68222
+ packageInfo
68026
68223
  );
68027
68224
  return withPackageId(packageInfo, fromDirectory, state);
68028
68225
  }
@@ -68032,10 +68229,9 @@ ${lanes.join("\n")}
68032
68229
  candidate2,
68033
68230
  onlyRecordFailures,
68034
68231
  state2,
68035
- packageInfo && packageInfo.contents.packageJsonContent,
68036
- packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
68232
+ packageInfo
68037
68233
  );
68038
- if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
68234
+ if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
68039
68235
  pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
68040
68236
  }
68041
68237
  return withPackageId(packageInfo, pathAndExtension, state2);
@@ -68485,6 +68681,7 @@ ${lanes.join("\n")}
68485
68681
  var preSwitchCaseFlow;
68486
68682
  var activeLabelList;
68487
68683
  var hasExplicitReturn;
68684
+ var inReturnPosition;
68488
68685
  var hasFlowEffects;
68489
68686
  var emitFlags;
68490
68687
  var inStrictMode;
@@ -68557,6 +68754,7 @@ ${lanes.join("\n")}
68557
68754
  currentExceptionTarget = void 0;
68558
68755
  activeLabelList = void 0;
68559
68756
  hasExplicitReturn = false;
68757
+ inReturnPosition = false;
68560
68758
  hasFlowEffects = false;
68561
68759
  inAssignmentPattern = false;
68562
68760
  emitFlags = 0;
@@ -68816,6 +69014,9 @@ ${lanes.join("\n")}
68816
69014
  const saveContainer = container;
68817
69015
  const saveThisParentContainer = thisParentContainer;
68818
69016
  const savedBlockScopeContainer = blockScopeContainer;
69017
+ const savedInReturnPosition = inReturnPosition;
69018
+ if (node.kind === 219 && node.body.kind !== 241)
69019
+ inReturnPosition = true;
68819
69020
  if (containerFlags & 1) {
68820
69021
  if (node.kind !== 219) {
68821
69022
  thisParentContainer = container;
@@ -68898,6 +69099,7 @@ ${lanes.join("\n")}
68898
69099
  } else {
68899
69100
  bindChildren(node);
68900
69101
  }
69102
+ inReturnPosition = savedInReturnPosition;
68901
69103
  container = saveContainer;
68902
69104
  thisParentContainer = saveThisParentContainer;
68903
69105
  blockScopeContainer = savedBlockScopeContainer;
@@ -68919,6 +69121,9 @@ ${lanes.join("\n")}
68919
69121
  const saveInAssignmentPattern = inAssignmentPattern;
68920
69122
  inAssignmentPattern = false;
68921
69123
  if (checkUnreachable(node)) {
69124
+ if (canHaveFlowNode(node) && node.flowNode) {
69125
+ node.flowNode = void 0;
69126
+ }
68922
69127
  bindEachChild(node);
68923
69128
  bindJSDoc(node);
68924
69129
  inAssignmentPattern = saveInAssignmentPattern;
@@ -69111,7 +69316,9 @@ ${lanes.join("\n")}
69111
69316
  case 36:
69112
69317
  case 37:
69113
69318
  case 38:
69114
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
69319
+ const left = skipParentheses(expr.left);
69320
+ const right = skipParentheses(expr.right);
69321
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
69115
69322
  case 104:
69116
69323
  return isNarrowableOperand(expr.left);
69117
69324
  case 103:
@@ -69303,13 +69510,16 @@ ${lanes.join("\n")}
69303
69510
  function bindForStatement(node) {
69304
69511
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
69305
69512
  const preBodyLabel = createBranchLabel();
69513
+ const preIncrementorLabel = createBranchLabel();
69306
69514
  const postLoopLabel = createBranchLabel();
69307
69515
  bind(node.initializer);
69308
69516
  addAntecedent(preLoopLabel, currentFlow);
69309
69517
  currentFlow = preLoopLabel;
69310
69518
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
69311
69519
  currentFlow = finishFlowLabel(preBodyLabel);
69312
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
69520
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
69521
+ addAntecedent(preIncrementorLabel, currentFlow);
69522
+ currentFlow = finishFlowLabel(preIncrementorLabel);
69313
69523
  bind(node.incrementor);
69314
69524
  addAntecedent(preLoopLabel, currentFlow);
69315
69525
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -69346,7 +69556,10 @@ ${lanes.join("\n")}
69346
69556
  currentFlow = finishFlowLabel(postIfLabel);
69347
69557
  }
69348
69558
  function bindReturnOrThrow(node) {
69559
+ const savedInReturnPosition = inReturnPosition;
69560
+ inReturnPosition = true;
69349
69561
  bind(node.expression);
69562
+ inReturnPosition = savedInReturnPosition;
69350
69563
  if (node.kind === 253) {
69351
69564
  hasExplicitReturn = true;
69352
69565
  if (currentReturnTarget) {
@@ -69711,10 +69924,16 @@ ${lanes.join("\n")}
69711
69924
  hasFlowEffects = false;
69712
69925
  bindCondition(node.condition, trueLabel, falseLabel);
69713
69926
  currentFlow = finishFlowLabel(trueLabel);
69927
+ if (inReturnPosition) {
69928
+ node.flowNodeWhenTrue = currentFlow;
69929
+ }
69714
69930
  bind(node.questionToken);
69715
69931
  bind(node.whenTrue);
69716
69932
  addAntecedent(postExpressionLabel, currentFlow);
69717
69933
  currentFlow = finishFlowLabel(falseLabel);
69934
+ if (inReturnPosition) {
69935
+ node.flowNodeWhenFalse = currentFlow;
69936
+ }
69718
69937
  bind(node.colonToken);
69719
69938
  bind(node.whenFalse);
69720
69939
  addAntecedent(postExpressionLabel, currentFlow);
@@ -73451,6 +73670,7 @@ ${lanes.join("\n")}
73451
73670
  getNumberLiteralType,
73452
73671
  getBigIntType: () => bigintType,
73453
73672
  getBigIntLiteralType,
73673
+ getUnknownType: () => unknownType,
73454
73674
  createPromiseType,
73455
73675
  createArrayType,
73456
73676
  getElementTypeOfArrayType,
@@ -73572,8 +73792,14 @@ ${lanes.join("\n")}
73572
73792
  getMemberOverrideModifierStatus,
73573
73793
  isTypeParameterPossiblyReferenced,
73574
73794
  typeHasCallOrConstructSignatures,
73575
- getSymbolFlags
73795
+ getSymbolFlags,
73796
+ getTypeArgumentsForResolvedSignature
73576
73797
  };
73798
+ function getTypeArgumentsForResolvedSignature(signature) {
73799
+ if (signature.mapper === void 0)
73800
+ return void 0;
73801
+ return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
73802
+ }
73577
73803
  function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
73578
73804
  const candidatesSet = /* @__PURE__ */ new Set();
73579
73805
  const candidates = [];
@@ -75091,9 +75317,9 @@ ${lanes.join("\n")}
75091
75317
  const containerKind = grandparent.parent.kind;
75092
75318
  if (containerKind === 264 && heritageKind === 96) {
75093
75319
  error22(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
75094
- } else if (containerKind === 263 && heritageKind === 96) {
75320
+ } else if (isClassLike(grandparent.parent) && heritageKind === 96) {
75095
75321
  error22(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
75096
- } else if (containerKind === 263 && heritageKind === 119) {
75322
+ } else if (isClassLike(grandparent.parent) && heritageKind === 119) {
75097
75323
  error22(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
75098
75324
  }
75099
75325
  } else {
@@ -76314,7 +76540,7 @@ ${lanes.join("\n")}
76314
76540
  moduleReference
76315
76541
  );
76316
76542
  }
76317
- if (errorNode && (moduleResolutionKind === 3 || moduleResolutionKind === 99)) {
76543
+ if (errorNode && (moduleKind === 100 || moduleKind === 101)) {
76318
76544
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
76319
76545
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
76320
76546
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 && !hasResolutionModeOverride(overrideHost)) {
@@ -77669,12 +77895,7 @@ ${lanes.join("\n")}
77669
77895
  enterNewScope(context, node) {
77670
77896
  if (isFunctionLike(node) || isJSDocSignature(node)) {
77671
77897
  const signature = getSignatureFromDeclaration(node);
77672
- const expandedParams = getExpandedParameters(
77673
- signature,
77674
- /*skipUnionExpanding*/
77675
- true
77676
- )[0];
77677
- return enterNewScope(context, node, expandedParams, signature.typeParameters);
77898
+ return enterNewScope(context, node, signature.parameters, signature.typeParameters);
77678
77899
  } else {
77679
77900
  const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
77680
77901
  return enterNewScope(
@@ -78424,7 +78645,7 @@ ${lanes.join("\n")}
78424
78645
  function shouldWriteTypeOfFunctionSymbol() {
78425
78646
  var _a3;
78426
78647
  const isStaticMethodSymbol = !!(symbol.flags & 8192) && // typeof static method
78427
- some(symbol.declarations, (declaration) => isStatic(declaration));
78648
+ some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
78428
78649
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || // is exported function symbol
78429
78650
  forEach(
78430
78651
  symbol.declarations,
@@ -78753,6 +78974,44 @@ ${lanes.join("\n")}
78753
78974
  ids.unshift(state);
78754
78975
  return ids;
78755
78976
  }
78977
+ function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
78978
+ if (indexInfo.components) {
78979
+ const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
78980
+ var _a2;
78981
+ return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a2 = isEntityNameVisible(
78982
+ e.name.expression,
78983
+ context2.enclosingDeclaration,
78984
+ /*shouldComputeAliasToMakeVisible*/
78985
+ false
78986
+ )) == null ? void 0 : _a2.accessibility) === 0);
78987
+ });
78988
+ if (allComponentComputedNamesSerializable) {
78989
+ const newComponents = filter(indexInfo.components, (e) => {
78990
+ return !hasLateBindableName(e);
78991
+ });
78992
+ return map(newComponents, (e) => {
78993
+ trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
78994
+ return setTextRange2(
78995
+ context2,
78996
+ factory.createPropertySignature(
78997
+ indexInfo.isReadonly ? [factory.createModifier(
78998
+ 148
78999
+ /* ReadonlyKeyword */
79000
+ )] : void 0,
79001
+ e.name,
79002
+ (isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
79003
+ 58
79004
+ /* QuestionToken */
79005
+ ) : void 0,
79006
+ typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
79007
+ ),
79008
+ e
79009
+ );
79010
+ });
79011
+ }
79012
+ }
79013
+ return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
79014
+ }
78756
79015
  function createTypeNodesFromResolvedType(resolvedType) {
78757
79016
  if (checkTruncationLength(context)) {
78758
79017
  if (context.flags & 1) {
@@ -78778,7 +79037,7 @@ ${lanes.join("\n")}
78778
79037
  typeElements.push(signatureToSignatureDeclarationHelper(signature, 180, context));
78779
79038
  }
78780
79039
  for (const info of resolvedType.indexInfos) {
78781
- typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context) : void 0));
79040
+ typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context) : void 0));
78782
79041
  }
78783
79042
  const properties = resolvedType.properties;
78784
79043
  if (!properties) {
@@ -79549,7 +79808,7 @@ ${lanes.join("\n")}
79549
79808
  return;
79550
79809
  const firstIdentifier = getFirstIdentifier(accessExpression);
79551
79810
  const name = resolveName(
79552
- firstIdentifier,
79811
+ enclosingDeclaration,
79553
79812
  firstIdentifier.escapedText,
79554
79813
  111551 | 1048576,
79555
79814
  /*nameNotFoundMessage*/
@@ -79564,6 +79823,24 @@ ${lanes.join("\n")}
79564
79823
  111551
79565
79824
  /* Value */
79566
79825
  );
79826
+ } else {
79827
+ const fallback = resolveName(
79828
+ firstIdentifier,
79829
+ firstIdentifier.escapedText,
79830
+ 111551 | 1048576,
79831
+ /*nameNotFoundMessage*/
79832
+ void 0,
79833
+ /*isUse*/
79834
+ true
79835
+ );
79836
+ if (fallback) {
79837
+ context.tracker.trackSymbol(
79838
+ fallback,
79839
+ enclosingDeclaration,
79840
+ 111551
79841
+ /* Value */
79842
+ );
79843
+ }
79567
79844
  }
79568
79845
  }
79569
79846
  function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
@@ -86959,8 +87236,8 @@ ${lanes.join("\n")}
86959
87236
  /* Index */
86960
87237
  );
86961
87238
  }
86962
- function createIndexInfo(keyType, type, isReadonly, declaration) {
86963
- return { keyType, type, isReadonly, declaration };
87239
+ function createIndexInfo(keyType, type, isReadonly, declaration, components) {
87240
+ return { keyType, type, isReadonly, declaration, components };
86964
87241
  }
86965
87242
  function getIndexInfosOfSymbol(symbol) {
86966
87243
  const indexSymbol = getIndexSymbol(symbol);
@@ -87501,6 +87778,9 @@ ${lanes.join("\n")}
87501
87778
  case "Number":
87502
87779
  checkNoTypeArguments(node);
87503
87780
  return numberType;
87781
+ case "BigInt":
87782
+ checkNoTypeArguments(node);
87783
+ return bigintType;
87504
87784
  case "Boolean":
87505
87785
  checkNoTypeArguments(node);
87506
87786
  return booleanType;
@@ -90186,7 +90466,7 @@ ${lanes.join("\n")}
90186
90466
  return result;
90187
90467
  }
90188
90468
  function getIndexInfoWithReadonly(info, readonly) {
90189
- return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
90469
+ return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
90190
90470
  }
90191
90471
  function createLiteralType(flags, value, symbol, regularType) {
90192
90472
  const type = createTypeWithSymbol(flags, symbol);
@@ -90954,7 +91234,7 @@ ${lanes.join("\n")}
90954
91234
  return type.restrictiveInstantiation;
90955
91235
  }
90956
91236
  function instantiateIndexInfo(info, mapper) {
90957
- return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
91237
+ return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
90958
91238
  }
90959
91239
  function isContextSensitive(node) {
90960
91240
  Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node));
@@ -95372,7 +95652,7 @@ ${lanes.join("\n")}
95372
95652
  }
95373
95653
  }
95374
95654
  }
95375
- const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
95655
+ const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
95376
95656
  result.objectFlags |= getObjectFlags(type) & (4096 | 262144);
95377
95657
  return result;
95378
95658
  }
@@ -96916,6 +97196,7 @@ ${lanes.join("\n")}
96916
97196
  return target.kind === 108;
96917
97197
  case 235:
96918
97198
  case 217:
97199
+ case 238:
96919
97200
  return isMatchingReference(source.expression, target);
96920
97201
  case 211:
96921
97202
  case 212:
@@ -98958,6 +99239,7 @@ ${lanes.join("\n")}
98958
99239
  if (checkDerived) {
98959
99240
  return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
98960
99241
  }
99242
+ type = type.flags & 2 ? unknownUnionType : type;
98961
99243
  const trueType2 = getNarrowedType(
98962
99244
  type,
98963
99245
  candidate,
@@ -98966,7 +99248,7 @@ ${lanes.join("\n")}
98966
99248
  /*checkDerived*/
98967
99249
  false
98968
99250
  );
98969
- return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
99251
+ return recombineUnknownType(filterType(type, (t) => !isTypeSubsetOf(t, trueType2)));
98970
99252
  }
98971
99253
  if (type.flags & 3) {
98972
99254
  return candidate;
@@ -99079,6 +99361,7 @@ ${lanes.join("\n")}
99079
99361
  return narrowTypeByCallExpression(type, expr, assumeTrue);
99080
99362
  case 217:
99081
99363
  case 235:
99364
+ case 238:
99082
99365
  return narrowType(type, expr.expression, assumeTrue);
99083
99366
  case 226:
99084
99367
  return narrowTypeByBinaryExpression(type, expr, assumeTrue);
@@ -99504,8 +99787,9 @@ ${lanes.join("\n")}
99504
99787
  }
99505
99788
  if (isJsxOpeningFragment(node)) {
99506
99789
  const file = getSourceFileOfNode(node);
99507
- const localJsxNamespace = getLocalJsxNamespace(file);
99508
- if (localJsxNamespace) {
99790
+ const entity = getJsxFactoryEntity(file);
99791
+ if (entity) {
99792
+ const localJsxNamespace = getFirstIdentifier(entity).escapedText;
99509
99793
  resolveName(
99510
99794
  jsxFactoryLocation,
99511
99795
  localJsxNamespace,
@@ -101877,12 +102161,22 @@ ${lanes.join("\n")}
101877
102161
  /* ESSymbol */
101878
102162
  );
101879
102163
  }
102164
+ function isSymbolWithComputedName(symbol) {
102165
+ var _a;
102166
+ const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
102167
+ return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
102168
+ }
101880
102169
  function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
102170
+ var _a;
101881
102171
  const propTypes = [];
102172
+ let components;
101882
102173
  for (let i = offset; i < properties.length; i++) {
101883
102174
  const prop = properties[i];
101884
102175
  if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
101885
102176
  propTypes.push(getTypeOfSymbol(properties[i]));
102177
+ if (isSymbolWithComputedName(properties[i])) {
102178
+ components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
102179
+ }
101886
102180
  }
101887
102181
  }
101888
102182
  const unionType = propTypes.length ? getUnionType(
@@ -101890,7 +102184,14 @@ ${lanes.join("\n")}
101890
102184
  2
101891
102185
  /* Subtype */
101892
102186
  ) : undefinedType;
101893
- return createIndexInfo(keyType, unionType, isReadonly);
102187
+ return createIndexInfo(
102188
+ keyType,
102189
+ unionType,
102190
+ isReadonly,
102191
+ /*declaration*/
102192
+ void 0,
102193
+ components
102194
+ );
101894
102195
  }
101895
102196
  function getImmediateAliasedSymbol(symbol) {
101896
102197
  Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
@@ -102482,6 +102783,9 @@ ${lanes.join("\n")}
102482
102783
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
102483
102784
  }
102484
102785
  function getJsxElementChildrenPropertyName(jsxNamespace) {
102786
+ if (compilerOptions.jsx === 4 || compilerOptions.jsx === 5) {
102787
+ return "children";
102788
+ }
102485
102789
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
102486
102790
  }
102487
102791
  function getUninstantiatedJsxSignaturesOfType(elementType, caller) {
@@ -104167,8 +104471,8 @@ ${lanes.join("\n")}
104167
104471
  }
104168
104472
  }
104169
104473
  function getEffectiveCheckNode(argument) {
104170
- argument = skipParentheses(argument);
104171
- return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
104474
+ const flags = isInJSFile(argument) ? 1 | 32 | -2147483648 : 1 | 32;
104475
+ return skipOuterExpressions(argument, flags);
104172
104476
  }
104173
104477
  function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
104174
104478
  const errorOutputContainer = { errors: void 0, skipLogging: true };
@@ -104597,11 +104901,16 @@ ${lanes.join("\n")}
104597
104901
  if (!result) {
104598
104902
  result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
104599
104903
  }
104904
+ const links = getNodeLinks(node);
104905
+ if (links.resolvedSignature !== resolvingSignature && !candidatesOutArray) {
104906
+ Debug.assert(links.resolvedSignature);
104907
+ return links.resolvedSignature;
104908
+ }
104600
104909
  if (result) {
104601
104910
  return result;
104602
104911
  }
104603
104912
  result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
104604
- getNodeLinks(node).resolvedSignature = result;
104913
+ links.resolvedSignature = result;
104605
104914
  if (reportErrors2) {
104606
104915
  if (!headMessage && isInstanceof) {
104607
104916
  headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method;
@@ -105622,7 +105931,7 @@ ${lanes.join("\n")}
105622
105931
  resolutionStart = resolutionTargets.length;
105623
105932
  }
105624
105933
  links.resolvedSignature = resolvingSignature;
105625
- let result = resolveSignature(
105934
+ const result = resolveSignature(
105626
105935
  node,
105627
105936
  candidatesOutArray,
105628
105937
  checkMode || 0
@@ -105630,9 +105939,6 @@ ${lanes.join("\n")}
105630
105939
  );
105631
105940
  resolutionStart = saveResolutionStart;
105632
105941
  if (result !== resolvingSignature) {
105633
- if (links.resolvedSignature !== resolvingSignature) {
105634
- result = links.resolvedSignature;
105635
- }
105636
105942
  links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
105637
105943
  }
105638
105944
  return result;
@@ -106245,12 +106551,12 @@ ${lanes.join("\n")}
106245
106551
  }
106246
106552
  }
106247
106553
  function checkImportMetaProperty(node) {
106248
- if (moduleKind === 100 || moduleKind === 199) {
106554
+ if (100 <= moduleKind && moduleKind <= 199) {
106249
106555
  if (getSourceFileOfNode(node).impliedNodeFormat !== 99) {
106250
106556
  error22(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
106251
106557
  }
106252
106558
  } else if (moduleKind < 6 && moduleKind !== 4) {
106253
- error22(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
106559
+ error22(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext);
106254
106560
  }
106255
106561
  const file = getSourceFileOfNode(node);
106256
106562
  Debug.assert(!!(file.flags & 8388608), "Containing file is missing import meta node flag.");
@@ -107135,7 +107441,7 @@ ${lanes.join("\n")}
107135
107441
  }
107136
107442
  return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
107137
107443
  }
107138
- const type = checkExpressionCached(node.expression);
107444
+ const type = getBaseConstraintOrType(checkExpressionCached(node.expression));
107139
107445
  if (!isLiteralType(type)) {
107140
107446
  return false;
107141
107447
  }
@@ -107416,19 +107722,7 @@ ${lanes.join("\n")}
107416
107722
  const exprType = checkExpression(node.body);
107417
107723
  const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
107418
107724
  if (returnOrPromisedType) {
107419
- const effectiveCheckNode = getEffectiveCheckNode(node.body);
107420
- if ((functionFlags & 3) === 2) {
107421
- const awaitedType = checkAwaitedType(
107422
- exprType,
107423
- /*withAlias*/
107424
- false,
107425
- effectiveCheckNode,
107426
- Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
107427
- );
107428
- checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
107429
- } else {
107430
- checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
107431
- }
107725
+ checkReturnExpression(node, returnOrPromisedType, node.body, node.body, exprType);
107432
107726
  }
107433
107727
  }
107434
107728
  }
@@ -107482,7 +107776,7 @@ ${lanes.join("\n")}
107482
107776
  }
107483
107777
  if (isReadonlySymbol(symbol)) {
107484
107778
  if (symbol.flags & 4 && isAccessExpression(expr) && expr.expression.kind === 110) {
107485
- const ctor = getContainingFunction(expr);
107779
+ const ctor = getControlFlowContainer(expr);
107486
107780
  if (!(ctor && (ctor.kind === 176 || isJSConstructor(ctor)))) {
107487
107781
  return true;
107488
107782
  }
@@ -107513,7 +107807,7 @@ ${lanes.join("\n")}
107513
107807
  function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) {
107514
107808
  const node = skipOuterExpressions(
107515
107809
  expr,
107516
- 6 | 1
107810
+ 38 | 1
107517
107811
  /* Parentheses */
107518
107812
  );
107519
107813
  if (node.kind !== 80 && !isAccessExpression(node)) {
@@ -107586,6 +107880,7 @@ ${lanes.join("\n")}
107586
107880
  }
107587
107881
  switch (moduleKind) {
107588
107882
  case 100:
107883
+ case 101:
107589
107884
  case 199:
107590
107885
  if (sourceFile.impliedNodeFormat === 1) {
107591
107886
  span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
@@ -107604,7 +107899,7 @@ ${lanes.join("\n")}
107604
107899
  }
107605
107900
  default:
107606
107901
  span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
107607
- const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
107902
+ const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
107608
107903
  diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message));
107609
107904
  hasError = true;
107610
107905
  break;
@@ -108240,7 +108535,7 @@ ${lanes.join("\n")}
108240
108535
  }
108241
108536
  const leftTarget = skipOuterExpressions(
108242
108537
  left,
108243
- 31
108538
+ 63
108244
108539
  /* All */
108245
108540
  );
108246
108541
  const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
@@ -109645,6 +109940,9 @@ ${lanes.join("\n")}
109645
109940
  31
109646
109941
  /* ParameterPropertyModifier */
109647
109942
  )) {
109943
+ if (compilerOptions.erasableSyntaxOnly) {
109944
+ error22(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
109945
+ }
109648
109946
  if (!(func.kind === 176 && nodeIsPresent(func.body))) {
109649
109947
  error22(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
109650
109948
  }
@@ -113158,7 +113456,6 @@ ${lanes.join("\n")}
113158
113456
  }
113159
113457
  const signature = getSignatureFromDeclaration(container);
113160
113458
  const returnType = getReturnTypeOfSignature(signature);
113161
- const functionFlags = getFunctionFlags(container);
113162
113459
  if (strictNullChecks || node.expression || returnType.flags & 131072) {
113163
113460
  const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
113164
113461
  if (container.kind === 178) {
@@ -113166,26 +113463,57 @@ ${lanes.join("\n")}
113166
113463
  error22(node, Diagnostics.Setters_cannot_return_a_value);
113167
113464
  }
113168
113465
  } else if (container.kind === 176) {
113169
- if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {
113466
+ const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType;
113467
+ if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) {
113170
113468
  error22(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
113171
113469
  }
113172
113470
  } else if (getReturnTypeFromAnnotation(container)) {
113173
- const unwrappedReturnType = unwrapReturnType(returnType, functionFlags) ?? returnType;
113174
- const unwrappedExprType = functionFlags & 2 ? checkAwaitedType(
113175
- exprType,
113176
- /*withAlias*/
113177
- false,
113178
- node,
113179
- Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
113180
- ) : exprType;
113181
- if (unwrappedReturnType) {
113182
- checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
113183
- }
113471
+ const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(container)) ?? returnType;
113472
+ checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType);
113184
113473
  }
113185
113474
  } else if (container.kind !== 176 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) {
113186
113475
  error22(node, Diagnostics.Not_all_code_paths_return_a_value);
113187
113476
  }
113188
113477
  }
113478
+ function checkReturnExpression(container, unwrappedReturnType, node, expr, exprType, inConditionalExpression = false) {
113479
+ const excludeJSDocTypeAssertions = isInJSFile(node);
113480
+ const functionFlags = getFunctionFlags(container);
113481
+ if (expr) {
113482
+ const unwrappedExpr = skipParentheses(expr, excludeJSDocTypeAssertions);
113483
+ if (isConditionalExpression(unwrappedExpr)) {
113484
+ checkReturnExpression(
113485
+ container,
113486
+ unwrappedReturnType,
113487
+ node,
113488
+ unwrappedExpr.whenTrue,
113489
+ checkExpression(unwrappedExpr.whenTrue),
113490
+ /*inConditionalExpression*/
113491
+ true
113492
+ );
113493
+ checkReturnExpression(
113494
+ container,
113495
+ unwrappedReturnType,
113496
+ node,
113497
+ unwrappedExpr.whenFalse,
113498
+ checkExpression(unwrappedExpr.whenFalse),
113499
+ /*inConditionalExpression*/
113500
+ true
113501
+ );
113502
+ return;
113503
+ }
113504
+ }
113505
+ const inReturnStatement = node.kind === 253;
113506
+ const unwrappedExprType = functionFlags & 2 ? checkAwaitedType(
113507
+ exprType,
113508
+ /*withAlias*/
113509
+ false,
113510
+ node,
113511
+ Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
113512
+ ) : exprType;
113513
+ const effectiveExpr = expr && getEffectiveCheckNode(expr);
113514
+ const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr;
113515
+ checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
113516
+ }
113189
113517
  function checkWithStatement(node) {
113190
113518
  if (!checkGrammarStatementInAmbientContext(node)) {
113191
113519
  if (node.flags & 65536) {
@@ -113317,7 +113645,7 @@ ${lanes.join("\n")}
113317
113645
  const typeDeclaration = symbol.valueDeclaration;
113318
113646
  if (typeDeclaration && isClassLike(typeDeclaration)) {
113319
113647
  for (const member of typeDeclaration.members) {
113320
- if (!isStatic(member) && !hasBindableName(member)) {
113648
+ if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
113321
113649
  const symbol2 = getSymbolOfDeclaration(member);
113322
113650
  checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
113323
113651
  }
@@ -113807,6 +114135,13 @@ ${lanes.join("\n")}
113807
114135
  function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
113808
114136
  const isJs = isInJSFile(node);
113809
114137
  const nodeInAmbientContext = !!(node.flags & 33554432);
114138
+ if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) {
114139
+ error22(
114140
+ errorNode,
114141
+ isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
114142
+ );
114143
+ return 2;
114144
+ }
113810
114145
  if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
113811
114146
  const thisType = memberIsStatic ? staticType : typeWithThis;
113812
114147
  const baseType = memberIsStatic ? baseStaticType : baseWithThis;
@@ -114427,6 +114762,9 @@ ${lanes.join("\n")}
114427
114762
  checkCollisionsForDeclarationName(node, node.name);
114428
114763
  checkExportsOnMergedDeclarations(node);
114429
114764
  node.members.forEach(checkEnumMember);
114765
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
114766
+ error22(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
114767
+ }
114430
114768
  computeEnumMemberValues(node);
114431
114769
  const enumSymbol = getSymbolOfDeclaration(node);
114432
114770
  const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);
@@ -114528,6 +114866,9 @@ ${lanes.join("\n")}
114528
114866
  checkExportsOnMergedDeclarations(node);
114529
114867
  const symbol = getSymbolOfDeclaration(node);
114530
114868
  if (symbol.flags & 512 && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) {
114869
+ if (compilerOptions.erasableSyntaxOnly) {
114870
+ error22(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
114871
+ }
114531
114872
  if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
114532
114873
  error22(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
114533
114874
  }
@@ -114868,10 +115209,20 @@ ${lanes.join("\n")}
114868
115209
  if (validForTypeAttributes && override) {
114869
115210
  return;
114870
115211
  }
114871
- const mode = moduleKind === 199 && declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier);
114872
- if (mode !== 99 && moduleKind !== 99 && moduleKind !== 200) {
114873
- const message = isImportAttributes2 ? moduleKind === 199 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
114874
- return grammarErrorOnNode(node, message);
115212
+ if (!moduleSupportsImportAttributes(moduleKind)) {
115213
+ return grammarErrorOnNode(
115214
+ node,
115215
+ isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
115216
+ );
115217
+ }
115218
+ if (moduleKind === 199 && !isImportAttributes2) {
115219
+ return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
115220
+ }
115221
+ if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1) {
115222
+ return grammarErrorOnNode(
115223
+ node,
115224
+ isImportAttributes2 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls
115225
+ );
114875
115226
  }
114876
115227
  const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly);
114877
115228
  if (isTypeOnly) {
@@ -114916,7 +115267,7 @@ ${lanes.join("\n")}
114916
115267
  }
114917
115268
  }
114918
115269
  }
114919
- if (!importClause.isTypeOnly && moduleKind === 199 && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
115270
+ if (!importClause.isTypeOnly && 101 <= moduleKind && moduleKind <= 199 && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
114920
115271
  error22(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
114921
115272
  }
114922
115273
  } else if (noUncheckedSideEffectImports && !importClause) {
@@ -114936,6 +115287,9 @@ ${lanes.join("\n")}
114936
115287
  return;
114937
115288
  }
114938
115289
  checkGrammarModifiers(node);
115290
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
115291
+ error22(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
115292
+ }
114939
115293
  if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
114940
115294
  checkImportBinding(node);
114941
115295
  markLinkedReferences(
@@ -115080,6 +115434,9 @@ ${lanes.join("\n")}
115080
115434
  if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
115081
115435
  return;
115082
115436
  }
115437
+ if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432)) {
115438
+ error22(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
115439
+ }
115083
115440
  const container = node.parent.kind === 307 ? node.parent : node.parent.parent;
115084
115441
  if (container.kind === 267 && !isAmbientModule(container)) {
115085
115442
  if (node.isExportEquals) {
@@ -116119,7 +116476,7 @@ ${lanes.join("\n")}
116119
116476
  name,
116120
116477
  meaning,
116121
116478
  /*ignoreErrors*/
116122
- false,
116479
+ true,
116123
116480
  /*dontResolveAlias*/
116124
116481
  true
116125
116482
  );
@@ -116129,8 +116486,9 @@ ${lanes.join("\n")}
116129
116486
  return resolveEntityName(
116130
116487
  name,
116131
116488
  /*meaning*/
116132
- 1
116133
- /* FunctionScopedVariable */
116489
+ 1,
116490
+ /*ignoreErrors*/
116491
+ true
116134
116492
  );
116135
116493
  }
116136
116494
  return void 0;
@@ -116317,8 +116675,9 @@ ${lanes.join("\n")}
116317
116675
  if (location && location.kind === 304) {
116318
116676
  return resolveEntityName(
116319
116677
  location.name,
116320
- 111551 | 2097152
116321
- /* Alias */
116678
+ 111551 | 2097152,
116679
+ /*ignoreErrors*/
116680
+ true
116322
116681
  );
116323
116682
  }
116324
116683
  return void 0;
@@ -116330,15 +116689,17 @@ ${lanes.join("\n")}
116330
116689
  // Skip for invalid syntax like this: export { "x" }
116331
116690
  resolveEntityName(
116332
116691
  name,
116333
- 111551 | 788968 | 1920 | 2097152
116334
- /* Alias */
116692
+ 111551 | 788968 | 1920 | 2097152,
116693
+ /*ignoreErrors*/
116694
+ true
116335
116695
  )
116336
116696
  );
116337
116697
  } else {
116338
116698
  return resolveEntityName(
116339
116699
  node,
116340
- 111551 | 788968 | 1920 | 2097152
116341
- /* Alias */
116700
+ 111551 | 788968 | 1920 | 2097152,
116701
+ /*ignoreErrors*/
116702
+ true
116342
116703
  );
116343
116704
  }
116344
116705
  }
@@ -117393,6 +117754,44 @@ ${lanes.join("\n")}
117393
117754
  continue;
117394
117755
  if (info === anyBaseTypeIndexInfo)
117395
117756
  continue;
117757
+ if (info.components) {
117758
+ const allComponentComputedNamesSerializable = every(info.components, (e) => {
117759
+ var _a;
117760
+ return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a = isEntityNameVisible(
117761
+ e.name.expression,
117762
+ enclosing,
117763
+ /*shouldComputeAliasToMakeVisible*/
117764
+ false
117765
+ )) == null ? void 0 : _a.accessibility) === 0);
117766
+ });
117767
+ if (allComponentComputedNamesSerializable) {
117768
+ const newComponents = filter(info.components, (e) => {
117769
+ return !hasLateBindableName(e);
117770
+ });
117771
+ result.push(...map(newComponents, (e) => {
117772
+ trackComputedName(e.name.expression);
117773
+ const mods = infoList === staticInfos ? [factory.createModifier(
117774
+ 126
117775
+ /* StaticKeyword */
117776
+ )] : void 0;
117777
+ return factory.createPropertyDeclaration(
117778
+ append(mods, info.isReadonly ? factory.createModifier(
117779
+ 148
117780
+ /* ReadonlyKeyword */
117781
+ ) : void 0),
117782
+ e.name,
117783
+ (isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
117784
+ 58
117785
+ /* QuestionToken */
117786
+ ) : void 0,
117787
+ nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker),
117788
+ /*initializer*/
117789
+ void 0
117790
+ );
117791
+ }));
117792
+ continue;
117793
+ }
117794
+ }
117396
117795
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
117397
117796
  if (node && infoList === staticInfos) {
117398
117797
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(
@@ -117406,6 +117805,28 @@ ${lanes.join("\n")}
117406
117805
  }
117407
117806
  }
117408
117807
  return result;
117808
+ function trackComputedName(accessExpression) {
117809
+ if (!tracker.trackSymbol)
117810
+ return;
117811
+ const firstIdentifier = getFirstIdentifier(accessExpression);
117812
+ const name = resolveName(
117813
+ firstIdentifier,
117814
+ firstIdentifier.escapedText,
117815
+ 111551 | 1048576,
117816
+ /*nameNotFoundMessage*/
117817
+ void 0,
117818
+ /*isUse*/
117819
+ true
117820
+ );
117821
+ if (name) {
117822
+ tracker.trackSymbol(
117823
+ name,
117824
+ enclosing,
117825
+ 111551
117826
+ /* Value */
117827
+ );
117828
+ }
117829
+ }
117409
117830
  }
117410
117831
  };
117411
117832
  function isImportRequiredByAugmentation(node) {
@@ -118536,6 +118957,7 @@ ${lanes.join("\n")}
118536
118957
  }
118537
118958
  switch (moduleKind) {
118538
118959
  case 100:
118960
+ case 101:
118539
118961
  case 199:
118540
118962
  if (sourceFile.impliedNodeFormat === 1) {
118541
118963
  diagnostics.add(
@@ -118552,7 +118974,7 @@ ${lanes.join("\n")}
118552
118974
  }
118553
118975
  default:
118554
118976
  diagnostics.add(
118555
- createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
118977
+ createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
118556
118978
  );
118557
118979
  break;
118558
118980
  }
@@ -118714,7 +119136,7 @@ ${lanes.join("\n")}
118714
119136
  }
118715
119137
  }
118716
119138
  function checkGrammarForInvalidDynamicName(node, message) {
118717
- if (isNonBindableDynamicName(node)) {
119139
+ if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
118718
119140
  return grammarErrorOnNode(node, message);
118719
119141
  }
118720
119142
  }
@@ -119181,17 +119603,17 @@ ${lanes.join("\n")}
119181
119603
  return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
119182
119604
  }
119183
119605
  if (moduleKind === 5) {
119184
- return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
119606
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext);
119185
119607
  }
119186
119608
  if (node.typeArguments) {
119187
119609
  return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
119188
119610
  }
119189
119611
  const nodeArguments = node.arguments;
119190
- if (moduleKind !== 99 && moduleKind !== 199 && moduleKind !== 100 && moduleKind !== 200) {
119612
+ if (!(100 <= moduleKind && moduleKind <= 199) && moduleKind !== 99 && moduleKind !== 200) {
119191
119613
  checkGrammarForDisallowedTrailingComma(nodeArguments);
119192
119614
  if (nodeArguments.length > 1) {
119193
119615
  const importAttributesArgument = nodeArguments[1];
119194
- return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve);
119616
+ return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve);
119195
119617
  }
119196
119618
  }
119197
119619
  if (nodeArguments.length === 0 || nodeArguments.length > 2) {
@@ -124254,7 +124676,7 @@ ${lanes.join("\n")}
124254
124676
  return updated;
124255
124677
  }
124256
124678
  function visitParenthesizedExpression(node) {
124257
- const innerExpression = skipOuterExpressions(node.expression, ~(6 | 16));
124679
+ const innerExpression = skipOuterExpressions(node.expression, ~(38 | 16));
124258
124680
  if (isAssertionExpression(innerExpression) || isSatisfiesExpression(innerExpression)) {
124259
124681
  const expression = visitNode(node.expression, visitor, isExpression);
124260
124682
  Debug.assert(expression);
@@ -143970,7 +144392,6 @@ ${lanes.join("\n")}
143970
144392
  if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) {
143971
144393
  return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift());
143972
144394
  }
143973
- break;
143974
144395
  default:
143975
144396
  if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
143976
144397
  return visitEachChild(node, visitor, context);
@@ -144824,11 +145245,7 @@ ${lanes.join("\n")}
144824
145245
  if (isSetAccessor(node.parent)) {
144825
145246
  return createAccessorTypeError(node.parent);
144826
145247
  }
144827
- const addUndefined = resolver.requiresAddingImplicitUndefined(
144828
- node,
144829
- /*enclosingDeclaration*/
144830
- void 0
144831
- );
145248
+ const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent);
144832
145249
  if (!addUndefined && node.initializer) {
144833
145250
  return createExpressionError(node.initializer);
144834
145251
  }
@@ -146653,6 +147070,7 @@ ${lanes.join("\n")}
146653
147070
  case 6:
146654
147071
  case 5:
146655
147072
  case 100:
147073
+ case 101:
146656
147074
  case 199:
146657
147075
  case 1:
146658
147076
  return transformImpliedNodeFormatDependentModule;
@@ -153556,47 +153974,6 @@ ${lanes.join("\n")}
153556
153974
  }
153557
153975
  return resolutions;
153558
153976
  }
153559
- function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
153560
- return forEachProjectReference(
153561
- /*projectReferences*/
153562
- void 0,
153563
- resolvedProjectReferences,
153564
- (resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
153565
- );
153566
- }
153567
- function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
153568
- let seenResolvedRefs;
153569
- return worker(
153570
- projectReferences,
153571
- resolvedProjectReferences,
153572
- /*parent*/
153573
- void 0
153574
- );
153575
- function worker(projectReferences2, resolvedProjectReferences2, parent2) {
153576
- if (cbRef) {
153577
- const result = cbRef(projectReferences2, parent2);
153578
- if (result)
153579
- return result;
153580
- }
153581
- let skipChildren;
153582
- return forEach(
153583
- resolvedProjectReferences2,
153584
- (resolvedRef, index) => {
153585
- if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
153586
- (skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
153587
- return void 0;
153588
- }
153589
- const result = cbResolvedRef(resolvedRef, parent2, index);
153590
- if (result || !resolvedRef)
153591
- return result;
153592
- (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
153593
- }
153594
- ) || forEach(
153595
- resolvedProjectReferences2,
153596
- (resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
153597
- );
153598
- }
153599
- }
153600
153977
  var inferredTypesContainingFile = "__inferred type names__.ts";
153601
153978
  function getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName) {
153602
153979
  const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory;
@@ -153612,13 +153989,6 @@ ${lanes.join("\n")}
153612
153989
  }
153613
153990
  return "@typescript/lib-" + path;
153614
153991
  }
153615
- function getLibNameFromLibReference(libReference) {
153616
- return toFileNameLowerCase(libReference.fileName);
153617
- }
153618
- function getLibFileNameFromLibReference(libReference) {
153619
- const libName = getLibNameFromLibReference(libReference);
153620
- return libMap.get(libName);
153621
- }
153622
153992
  function isReferencedFile(reason) {
153623
153993
  switch (reason == null ? void 0 : reason.kind) {
153624
153994
  case 3:
@@ -153867,11 +154237,13 @@ ${lanes.join("\n")}
153867
154237
  typeScriptVersion: typeScriptVersion3
153868
154238
  };
153869
154239
  }
153870
- function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
154240
+ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
153871
154241
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
153872
- const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
153873
- const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
153874
- let { oldProgram } = createProgramOptions;
154242
+ let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions;
154243
+ const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3, host: createProgramOptionsHost } = _createProgramOptions;
154244
+ let { oldProgram } = _createProgramOptions;
154245
+ _createProgramOptions = void 0;
154246
+ _rootNamesOrOptions = void 0;
153875
154247
  for (const option of commandLineOptionOfCustomType) {
153876
154248
  if (hasProperty(options, option.name)) {
153877
154249
  if (typeof options[option.name] === "string") {
@@ -153884,16 +154256,12 @@ ${lanes.join("\n")}
153884
154256
  let processingOtherFiles;
153885
154257
  let files;
153886
154258
  let symlinks;
153887
- let commonSourceDirectory;
153888
154259
  let typeChecker;
153889
154260
  let classifiableNames;
153890
- let fileReasons = createMultiMap();
153891
154261
  let filesWithReferencesProcessed;
153892
- let fileReasonsToChain;
153893
- let reasonToRelatedInfo;
153894
154262
  let cachedBindAndCheckDiagnosticsForFile;
153895
154263
  let cachedDeclarationDiagnosticsForFile;
153896
- let fileProcessingDiagnostics;
154264
+ const programDiagnostics = createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax);
153897
154265
  let automaticTypeDirectiveNames;
153898
154266
  let automaticTypeDirectiveResolutions;
153899
154267
  let resolvedLibReferences;
@@ -153915,13 +154283,12 @@ ${lanes.join("\n")}
153915
154283
  true
153916
154284
  );
153917
154285
  mark("beforeProgram");
153918
- const host = createProgramOptions.host || createCompilerHost(options);
154286
+ const host = createProgramOptionsHost || createCompilerHost(options);
153919
154287
  const configParsingHost = parseConfigHostFromCompilerHostLike(host);
153920
154288
  let skipDefaultLib = options.noLib;
153921
154289
  const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
153922
154290
  const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
153923
- const programDiagnostics = createDiagnosticCollection();
153924
- let lazyProgramDiagnosticExplainingFile = [];
154291
+ let skipVerifyCompilerOptions = false;
153925
154292
  const currentDirectory = host.getCurrentDirectory();
153926
154293
  const supportedExtensions = getSupportedExtensions(options);
153927
154294
  const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
@@ -154207,7 +154574,7 @@ ${lanes.join("\n")}
154207
154574
  getTypeCount: () => getTypeChecker().getTypeCount(),
154208
154575
  getInstantiationCount: () => getTypeChecker().getInstantiationCount(),
154209
154576
  getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(),
154210
- getFileProcessingDiagnostics: () => fileProcessingDiagnostics,
154577
+ getFileProcessingDiagnostics: () => programDiagnostics.getFileProcessingDiagnostics(),
154211
154578
  getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames,
154212
154579
  getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions,
154213
154580
  isSourceFileFromExternalLibrary,
@@ -154223,6 +154590,7 @@ ${lanes.join("\n")}
154223
154590
  resolvedModules,
154224
154591
  resolvedTypeReferenceDirectiveNames,
154225
154592
  resolvedLibReferences,
154593
+ getProgramDiagnosticsContainer: () => programDiagnostics,
154226
154594
  getResolvedModule,
154227
154595
  getResolvedModuleFromModuleSpecifier,
154228
154596
  getResolvedTypeReferenceDirective,
@@ -154255,70 +154623,19 @@ ${lanes.join("\n")}
154255
154623
  realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
154256
154624
  useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
154257
154625
  getCanonicalFileName,
154258
- getFileIncludeReasons: () => fileReasons,
154626
+ getFileIncludeReasons: () => programDiagnostics.getFileReasons(),
154259
154627
  structureIsReused,
154260
154628
  writeFile: writeFile2,
154261
154629
  getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
154262
154630
  };
154263
154631
  onProgramCreateComplete();
154264
- verifyCompilerOptions();
154632
+ if (!skipVerifyCompilerOptions) {
154633
+ verifyCompilerOptions();
154634
+ }
154265
154635
  mark("afterProgram");
154266
154636
  measure("Program", "beforeProgram", "afterProgram");
154267
154637
  (_p = tracing) == null ? void 0 : _p.pop();
154268
154638
  return program2;
154269
- function updateAndGetProgramDiagnostics() {
154270
- if (lazyProgramDiagnosticExplainingFile) {
154271
- fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
154272
- switch (diagnostic.kind) {
154273
- case 1:
154274
- return programDiagnostics.add(
154275
- createDiagnosticExplainingFile(
154276
- diagnostic.file && getSourceFileByPath(diagnostic.file),
154277
- diagnostic.fileProcessingReason,
154278
- diagnostic.diagnostic,
154279
- diagnostic.args || emptyArray
154280
- )
154281
- );
154282
- case 0:
154283
- return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic));
154284
- case 2:
154285
- return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
154286
- default:
154287
- Debug.assertNever(diagnostic);
154288
- }
154289
- });
154290
- lazyProgramDiagnosticExplainingFile.forEach(
154291
- ({ file, diagnostic, args }) => programDiagnostics.add(
154292
- createDiagnosticExplainingFile(
154293
- file,
154294
- /*fileProcessingReason*/
154295
- void 0,
154296
- diagnostic,
154297
- args
154298
- )
154299
- )
154300
- );
154301
- lazyProgramDiagnosticExplainingFile = void 0;
154302
- fileReasonsToChain = void 0;
154303
- reasonToRelatedInfo = void 0;
154304
- }
154305
- return programDiagnostics;
154306
- }
154307
- function filePreprocessingLibreferenceDiagnostic({ reason }) {
154308
- const { file, pos, end } = getReferencedFileLocation(program2, reason);
154309
- const libReference = file.libReferenceDirectives[reason.index];
154310
- const libName = getLibNameFromLibReference(libReference);
154311
- const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
154312
- const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
154313
- return createFileDiagnostic(
154314
- file,
154315
- Debug.checkDefined(pos),
154316
- Debug.checkDefined(end) - pos,
154317
- suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
154318
- libName,
154319
- suggestion
154320
- );
154321
- }
154322
154639
  function getResolvedModule(file, moduleName, mode) {
154323
154640
  var _a2;
154324
154641
  return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
@@ -154372,7 +154689,7 @@ ${lanes.join("\n")}
154372
154689
  var _a2;
154373
154690
  if (!((_a2 = resolution.resolutionDiagnostics) == null ? void 0 : _a2.length))
154374
154691
  return;
154375
- (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
154692
+ programDiagnostics.addFileProcessingDiagnostic({
154376
154693
  kind: 2,
154377
154694
  diagnostics: resolution.resolutionDiagnostics
154378
154695
  });
@@ -154477,16 +154794,19 @@ ${lanes.join("\n")}
154477
154794
  return toPath(fileName, currentDirectory, getCanonicalFileName);
154478
154795
  }
154479
154796
  function getCommonSourceDirectory2() {
154480
- if (commonSourceDirectory === void 0) {
154481
- const emittedFiles = filter(files, (file) => sourceFileMayBeEmitted(file, program2));
154482
- commonSourceDirectory = getCommonSourceDirectory(
154483
- options,
154484
- () => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
154485
- currentDirectory,
154486
- getCanonicalFileName,
154487
- (commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
154488
- );
154797
+ let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory();
154798
+ if (commonSourceDirectory !== void 0) {
154799
+ return commonSourceDirectory;
154489
154800
  }
154801
+ const emittedFiles = filter(files, (file) => sourceFileMayBeEmitted(file, program2));
154802
+ commonSourceDirectory = getCommonSourceDirectory(
154803
+ options,
154804
+ () => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
154805
+ currentDirectory,
154806
+ getCanonicalFileName,
154807
+ (commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
154808
+ );
154809
+ programDiagnostics.setCommonSourceDirectory(commonSourceDirectory);
154490
154810
  return commonSourceDirectory;
154491
154811
  }
154492
154812
  function getClassifiableNames() {
@@ -154804,9 +155124,10 @@ ${lanes.join("\n")}
154804
155124
  }
154805
155125
  filesByName.set(path, filesByName.get(oldFile.path));
154806
155126
  });
155127
+ const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations);
155128
+ programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical);
155129
+ skipVerifyCompilerOptions = isConfigIdentical;
154807
155130
  files = newSourceFiles;
154808
- fileReasons = oldProgram.getFileIncludeReasons();
154809
- fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
154810
155131
  automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames();
154811
155132
  automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions();
154812
155133
  sourceFileToPackageName = oldProgram.sourceFileToPackageName;
@@ -155025,7 +155346,7 @@ ${lanes.join("\n")}
155025
155346
  if (skipTypeChecking(sourceFile, options, program2)) {
155026
155347
  return emptyArray;
155027
155348
  }
155028
- const programDiagnosticsInFile = updateAndGetProgramDiagnostics().getDiagnostics(sourceFile.fileName);
155349
+ const programDiagnosticsInFile = programDiagnostics.getCombinedDiagnostics(program2).getDiagnostics(sourceFile.fileName);
155029
155350
  if (!((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) {
155030
155351
  return programDiagnosticsInFile;
155031
155352
  }
@@ -155394,16 +155715,16 @@ ${lanes.join("\n")}
155394
155715
  }
155395
155716
  function getOptionsDiagnostics() {
155396
155717
  return sortAndDeduplicateDiagnostics(concatenate(
155397
- updateAndGetProgramDiagnostics().getGlobalDiagnostics(),
155718
+ programDiagnostics.getCombinedDiagnostics(program2).getGlobalDiagnostics(),
155398
155719
  getOptionsDiagnosticsOfConfigFile()
155399
155720
  ));
155400
155721
  }
155401
155722
  function getOptionsDiagnosticsOfConfigFile() {
155402
155723
  if (!options.configFile)
155403
155724
  return emptyArray;
155404
- let diagnostics = updateAndGetProgramDiagnostics().getDiagnostics(options.configFile.fileName);
155725
+ let diagnostics = programDiagnostics.getCombinedDiagnostics(program2).getDiagnostics(options.configFile.fileName);
155405
155726
  forEachResolvedProjectReference2((resolvedRef) => {
155406
- diagnostics = concatenate(diagnostics, updateAndGetProgramDiagnostics().getDiagnostics(resolvedRef.sourceFile.fileName));
155727
+ diagnostics = concatenate(diagnostics, programDiagnostics.getCombinedDiagnostics(program2).getDiagnostics(resolvedRef.sourceFile.fileName));
155407
155728
  });
155408
155729
  return diagnostics;
155409
155730
  }
@@ -155620,7 +155941,7 @@ ${lanes.join("\n")}
155620
155941
  );
155621
155942
  }
155622
155943
  function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {
155623
- const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(fileReasons.get(existingFile.path), isReferencedFile);
155944
+ const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(programDiagnostics.getFileReasons().get(existingFile.path), isReferencedFile);
155624
155945
  if (hasExistingReasonToReportErrorOn) {
155625
155946
  addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);
155626
155947
  } else {
@@ -155809,7 +156130,7 @@ ${lanes.join("\n")}
155809
156130
  }
155810
156131
  function addFileIncludeReason(file, reason, checkExisting) {
155811
156132
  if (file && (!checkExisting || !isReferencedFile(reason) || !(filesWithReferencesProcessed == null ? void 0 : filesWithReferencesProcessed.has(reason.file)))) {
155812
- fileReasons.add(file.path, reason);
156133
+ programDiagnostics.getFileReasons().add(file.path, reason);
155813
156134
  return true;
155814
156135
  }
155815
156136
  return false;
@@ -155985,6 +156306,16 @@ ${lanes.join("\n")}
155985
156306
  const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName);
155986
156307
  if (existing)
155987
156308
  return existing;
156309
+ if (options.libReplacement === false) {
156310
+ const result2 = {
156311
+ resolution: {
156312
+ resolvedModule: void 0
156313
+ },
156314
+ actual: combinePaths(defaultLibraryPath, libFileName)
156315
+ };
156316
+ (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2);
156317
+ return result2;
156318
+ }
155988
156319
  if (structureIsReused !== 0 && oldProgram && !hasInvalidatedLibResolutions(libFileName)) {
155989
156320
  const oldResolution = (_a2 = oldProgram.resolvedLibReferences) == null ? void 0 : _a2.get(libFileName);
155990
156321
  if (oldResolution) {
@@ -156032,7 +156363,7 @@ ${lanes.join("\n")}
156032
156363
  { kind: 7, file: file.path, index }
156033
156364
  );
156034
156365
  } else {
156035
- (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({
156366
+ programDiagnostics.addFileProcessingDiagnostic({
156036
156367
  kind: 0,
156037
156368
  reason: { kind: 7, file: file.path, index }
156038
156369
  });
@@ -156095,10 +156426,11 @@ ${lanes.join("\n")}
156095
156426
  if (!sourceFile.isDeclarationFile) {
156096
156427
  const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
156097
156428
  if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
156098
- addLazyProgramDiagnosticExplainingFile(
156429
+ programDiagnostics.addLazyConfigDiagnostic(
156099
156430
  sourceFile,
156100
156431
  Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
156101
- [sourceFile.fileName, rootDirectory]
156432
+ sourceFile.fileName,
156433
+ rootDirectory
156102
156434
  );
156103
156435
  allFilesBelongToPath = false;
156104
156436
  }
@@ -156217,7 +156549,7 @@ ${lanes.join("\n")}
156217
156549
  }
156218
156550
  const outputFile4 = options.outFile;
156219
156551
  if (!options.tsBuildInfoFile && options.incremental && !outputFile4 && !options.configFilePath) {
156220
- programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
156552
+ programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
156221
156553
  }
156222
156554
  verifyDeprecatedCompilerOptions();
156223
156555
  verifyProjectReferences();
@@ -156225,10 +156557,11 @@ ${lanes.join("\n")}
156225
156557
  const rootPaths = new Set(rootNames.map(toPath3));
156226
156558
  for (const file of files) {
156227
156559
  if (sourceFileMayBeEmitted(file, program2) && !rootPaths.has(file.path)) {
156228
- addLazyProgramDiagnosticExplainingFile(
156560
+ programDiagnostics.addLazyConfigDiagnostic(
156229
156561
  file,
156230
156562
  Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
156231
- [file.fileName, options.configFilePath || ""]
156563
+ file.fileName,
156564
+ options.configFilePath || ""
156232
156565
  );
156233
156566
  }
156234
156567
  }
@@ -156319,14 +156652,14 @@ ${lanes.join("\n")}
156319
156652
  }
156320
156653
  } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === 0) {
156321
156654
  const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
156322
- programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
156655
+ programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
156323
156656
  }
156324
156657
  if (outputFile4 && !options.emitDeclarationOnly) {
156325
156658
  if (options.module && !(options.module === 2 || options.module === 4)) {
156326
156659
  createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, "outFile", "module");
156327
156660
  } else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) {
156328
156661
  const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
156329
- programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile"));
156662
+ programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile"));
156330
156663
  }
156331
156664
  }
156332
156665
  if (getResolveJsonModule(options)) {
@@ -156415,7 +156748,8 @@ ${lanes.join("\n")}
156415
156748
  }
156416
156749
  if (ModuleKind[moduleKind] && (100 <= moduleKind && moduleKind <= 199) && !(3 <= moduleResolution && moduleResolution <= 99)) {
156417
156750
  const moduleKindName = ModuleKind[moduleKind];
156418
- createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleKindName, moduleKindName);
156751
+ const moduleResolutionName = ModuleResolutionKind[moduleKindName] ? moduleKindName : "Node16";
156752
+ createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleResolutionName, moduleKindName);
156419
156753
  } else if (ModuleResolutionKind[moduleResolution] && (3 <= moduleResolution && moduleResolution <= 99) && !(100 <= moduleKind && moduleKind <= 199)) {
156420
156754
  const moduleResolutionName = ModuleResolutionKind[moduleResolution];
156421
156755
  createOptionValueDiagnostic("module", Diagnostics.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, moduleResolutionName, moduleResolutionName);
@@ -156577,95 +156911,8 @@ ${lanes.join("\n")}
156577
156911
  }
156578
156912
  });
156579
156913
  }
156580
- function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
156581
- let seenReasons;
156582
- const reasons = file && fileReasons.get(file.path);
156583
- let fileIncludeReasons;
156584
- let relatedInfo;
156585
- let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
156586
- let fileIncludeReasonDetails;
156587
- let redirectInfo;
156588
- let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
156589
- let chain;
156590
- if (cachedChain) {
156591
- if (cachedChain.fileIncludeReasonDetails) {
156592
- seenReasons = new Set(reasons);
156593
- reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
156594
- } else {
156595
- reasons == null ? void 0 : reasons.forEach(processReason);
156596
- }
156597
- redirectInfo = cachedChain.redirectInfo;
156598
- } else {
156599
- reasons == null ? void 0 : reasons.forEach(processReason);
156600
- redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file));
156601
- }
156602
- if (fileProcessingReason)
156603
- processReason(fileProcessingReason);
156604
- const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
156605
- if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1)
156606
- seenReasons = void 0;
156607
- if (seenReasons && cachedChain) {
156608
- if (cachedChain.details && !processedExtraReason) {
156609
- chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray);
156610
- } else if (cachedChain.fileIncludeReasonDetails) {
156611
- if (!processedExtraReason) {
156612
- if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
156613
- fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
156614
- } else {
156615
- fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
156616
- }
156617
- } else {
156618
- if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
156619
- fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
156620
- } else {
156621
- fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
156622
- }
156623
- }
156624
- }
156625
- }
156626
- if (!chain) {
156627
- if (!fileIncludeReasonDetails)
156628
- fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
156629
- chain = chainDiagnosticMessages(
156630
- redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
156631
- diagnostic,
156632
- ...args || emptyArray
156633
- );
156634
- }
156635
- if (file) {
156636
- if (cachedChain) {
156637
- if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
156638
- cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
156639
- }
156640
- } else {
156641
- (fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
156642
- }
156643
- if (!cachedChain.details && !processedExtraReason)
156644
- cachedChain.details = chain.next;
156645
- }
156646
- const location = locationReason && getReferencedFileLocation(program2, locationReason);
156647
- return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
156648
- function processReason(reason) {
156649
- if (seenReasons == null ? void 0 : seenReasons.has(reason))
156650
- return;
156651
- (seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
156652
- (fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program2, reason));
156653
- populateRelatedInfo(reason);
156654
- }
156655
- function populateRelatedInfo(reason) {
156656
- if (!locationReason && isReferencedFile(reason)) {
156657
- locationReason = reason;
156658
- } else if (locationReason !== reason) {
156659
- relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(reason));
156660
- }
156661
- }
156662
- function cachedFileIncludeDetailsHasProcessedExtraReason() {
156663
- var _a2;
156664
- return ((_a2 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a2.length) !== (reasons == null ? void 0 : reasons.length);
156665
- }
156666
- }
156667
156914
  function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {
156668
- (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({
156915
+ programDiagnostics.addFileProcessingDiagnostic({
156669
156916
  kind: 1,
156670
156917
  file: file && file.path,
156671
156918
  fileProcessingReason,
@@ -156673,105 +156920,6 @@ ${lanes.join("\n")}
156673
156920
  args
156674
156921
  });
156675
156922
  }
156676
- function addLazyProgramDiagnosticExplainingFile(file, diagnostic, args) {
156677
- lazyProgramDiagnosticExplainingFile.push({ file, diagnostic, args });
156678
- }
156679
- function getFileIncludeReasonToRelatedInformation(reason) {
156680
- let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
156681
- if (relatedInfo === void 0)
156682
- (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(reason) ?? false);
156683
- return relatedInfo || void 0;
156684
- }
156685
- function fileIncludeReasonToRelatedInformation(reason) {
156686
- if (isReferencedFile(reason)) {
156687
- const referenceLocation = getReferencedFileLocation(program2, reason);
156688
- let message2;
156689
- switch (reason.kind) {
156690
- case 3:
156691
- message2 = Diagnostics.File_is_included_via_import_here;
156692
- break;
156693
- case 4:
156694
- message2 = Diagnostics.File_is_included_via_reference_here;
156695
- break;
156696
- case 5:
156697
- message2 = Diagnostics.File_is_included_via_type_library_reference_here;
156698
- break;
156699
- case 7:
156700
- message2 = Diagnostics.File_is_included_via_library_reference_here;
156701
- break;
156702
- default:
156703
- Debug.assertNever(reason);
156704
- }
156705
- return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
156706
- referenceLocation.file,
156707
- referenceLocation.pos,
156708
- referenceLocation.end - referenceLocation.pos,
156709
- message2
156710
- ) : void 0;
156711
- }
156712
- if (!options.configFile)
156713
- return void 0;
156714
- let configFileNode;
156715
- let message;
156716
- switch (reason.kind) {
156717
- case 0:
156718
- if (!options.configFile.configFileSpecs)
156719
- return void 0;
156720
- const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
156721
- const matchedByFiles = getMatchedFileSpec(program2, fileName);
156722
- if (matchedByFiles) {
156723
- configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
156724
- message = Diagnostics.File_is_matched_by_files_list_specified_here;
156725
- break;
156726
- }
156727
- const matchedByInclude = getMatchedIncludeSpec(program2, fileName);
156728
- if (!matchedByInclude || !isString(matchedByInclude))
156729
- return void 0;
156730
- configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
156731
- message = Diagnostics.File_is_matched_by_include_pattern_specified_here;
156732
- break;
156733
- case 1:
156734
- case 2:
156735
- const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
156736
- const referenceInfo = forEachProjectReference(
156737
- projectReferences,
156738
- resolvedProjectReferences,
156739
- (resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
156740
- );
156741
- if (!referenceInfo)
156742
- return void 0;
156743
- const { sourceFile, index } = referenceInfo;
156744
- const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
156745
- return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
156746
- sourceFile,
156747
- referencesSyntax.elements[index],
156748
- reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
156749
- ) : void 0;
156750
- case 8:
156751
- if (!options.types)
156752
- return void 0;
156753
- configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
156754
- message = Diagnostics.File_is_entry_point_of_type_library_specified_here;
156755
- break;
156756
- case 6:
156757
- if (reason.index !== void 0) {
156758
- configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
156759
- message = Diagnostics.File_is_library_specified_here;
156760
- break;
156761
- }
156762
- const target = getNameOfScriptTarget(getEmitScriptTarget(options));
156763
- configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
156764
- message = Diagnostics.File_is_default_library_for_target_specified_here;
156765
- break;
156766
- default:
156767
- Debug.assertNever(reason);
156768
- }
156769
- return configFileNode && createDiagnosticForNodeInSourceFile(
156770
- options.configFile,
156771
- configFileNode,
156772
- message
156773
- );
156774
- }
156775
156923
  function verifyProjectReferences() {
156776
156924
  const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0;
156777
156925
  forEachProjectReference(
@@ -156809,7 +156957,7 @@ ${lanes.join("\n")}
156809
156957
  forEachPropertyAssignment(pathProp.initializer, key, (keyProps) => {
156810
156958
  const initializer = keyProps.initializer;
156811
156959
  if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {
156812
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, ...args));
156960
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, ...args));
156813
156961
  needCompilerDiagnostic = false;
156814
156962
  }
156815
156963
  });
@@ -156838,18 +156986,8 @@ ${lanes.join("\n")}
156838
156986
  createCompilerOptionsDiagnostic(message, ...args);
156839
156987
  }
156840
156988
  }
156841
- function forEachOptionsSyntaxByName(name, callback) {
156842
- return forEachPropertyAssignment(getCompilerOptionsObjectLiteralSyntax(), name, callback);
156843
- }
156844
156989
  function forEachOptionPathsSyntax(callback) {
156845
- return forEachOptionsSyntaxByName("paths", callback);
156846
- }
156847
- function getOptionsSyntaxByValue(name, value) {
156848
- return forEachOptionsSyntaxByName(name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : void 0);
156849
- }
156850
- function getOptionsSyntaxByArrayElementValue(name, value) {
156851
- const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
156852
- return compilerOptionsObjectLiteralSyntax && getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name, value);
156990
+ return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(), "paths", callback);
156853
156991
  }
156854
156992
  function createDiagnosticForOptionName(message, option1, option2, option3) {
156855
156993
  createDiagnosticForOption(
@@ -156877,9 +157015,9 @@ ${lanes.join("\n")}
156877
157015
  function createDiagnosticForReference(sourceFile, index, message, ...args) {
156878
157016
  const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
156879
157017
  if (referencesSyntax && referencesSyntax.elements.length > index) {
156880
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args));
157018
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args));
156881
157019
  } else {
156882
- programDiagnostics.add(createCompilerDiagnostic(message, ...args));
157020
+ programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args));
156883
157021
  }
156884
157022
  }
156885
157023
  function createDiagnosticForOption(onKey, option1, option2, message, ...args) {
@@ -156893,14 +157031,14 @@ ${lanes.join("\n")}
156893
157031
  const compilerOptionsProperty = getCompilerOptionsPropertySyntax();
156894
157032
  if (compilerOptionsProperty) {
156895
157033
  if ("messageText" in message) {
156896
- programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, compilerOptionsProperty.name, message));
157034
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, compilerOptionsProperty.name, message));
156897
157035
  } else {
156898
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, compilerOptionsProperty.name, message, ...args));
157036
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, compilerOptionsProperty.name, message, ...args));
156899
157037
  }
156900
157038
  } else if ("messageText" in message) {
156901
- programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message));
157039
+ programDiagnostics.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(message));
156902
157040
  } else {
156903
- programDiagnostics.add(createCompilerDiagnostic(message, ...args));
157041
+ programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args));
156904
157042
  }
156905
157043
  }
156906
157044
  function getCompilerOptionsObjectLiteralSyntax() {
@@ -156924,9 +157062,9 @@ ${lanes.join("\n")}
156924
157062
  let needsCompilerDiagnostic = false;
156925
157063
  forEachPropertyAssignment(objectLiteral, key1, (prop) => {
156926
157064
  if ("messageText" in message) {
156927
- programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message));
157065
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message));
156928
157066
  } else {
156929
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, ...args));
157067
+ programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, ...args));
156930
157068
  }
156931
157069
  needsCompilerDiagnostic = true;
156932
157070
  }, key2);
@@ -156934,7 +157072,7 @@ ${lanes.join("\n")}
156934
157072
  }
156935
157073
  function blockEmittingOfFile(emitFileName, diag2) {
156936
157074
  hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true);
156937
- programDiagnostics.add(diag2);
157075
+ programDiagnostics.addConfigDiagnostic(diag2);
156938
157076
  }
156939
157077
  function isEmittedFile(file) {
156940
157078
  if (options.noEmit) {
@@ -157292,6 +157430,302 @@ ${lanes.join("\n")}
157292
157430
  }
157293
157431
  Debug.fail("should never ask for module name at index higher than possible module name");
157294
157432
  }
157433
+ function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax) {
157434
+ let computedDiagnostics;
157435
+ let fileReasons = createMultiMap();
157436
+ let fileProcessingDiagnostics;
157437
+ let commonSourceDirectory;
157438
+ let configDiagnostics;
157439
+ let lazyConfigDiagnostics;
157440
+ let fileReasonsToChain;
157441
+ let reasonToRelatedInfo;
157442
+ return {
157443
+ addConfigDiagnostic(diag2) {
157444
+ Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
157445
+ (configDiagnostics ?? (configDiagnostics = createDiagnosticCollection())).add(diag2);
157446
+ },
157447
+ addLazyConfigDiagnostic(file, message, ...args) {
157448
+ Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
157449
+ (lazyConfigDiagnostics ?? (lazyConfigDiagnostics = [])).push({ file, diagnostic: message, args });
157450
+ },
157451
+ addFileProcessingDiagnostic(diag2) {
157452
+ Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
157453
+ (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push(diag2);
157454
+ },
157455
+ setCommonSourceDirectory(directory) {
157456
+ commonSourceDirectory = directory;
157457
+ },
157458
+ reuseStateFromOldProgram(oldProgramDiagnostics, isConfigIdentical) {
157459
+ fileReasons = oldProgramDiagnostics.getFileReasons();
157460
+ fileProcessingDiagnostics = oldProgramDiagnostics.getFileProcessingDiagnostics();
157461
+ if (isConfigIdentical) {
157462
+ commonSourceDirectory = oldProgramDiagnostics.getCommonSourceDirectory();
157463
+ configDiagnostics = oldProgramDiagnostics.getConfigDiagnostics();
157464
+ lazyConfigDiagnostics = oldProgramDiagnostics.getLazyConfigDiagnostics();
157465
+ }
157466
+ },
157467
+ getFileProcessingDiagnostics() {
157468
+ return fileProcessingDiagnostics;
157469
+ },
157470
+ getFileReasons() {
157471
+ return fileReasons;
157472
+ },
157473
+ getCommonSourceDirectory() {
157474
+ return commonSourceDirectory;
157475
+ },
157476
+ getConfigDiagnostics() {
157477
+ return configDiagnostics;
157478
+ },
157479
+ getLazyConfigDiagnostics() {
157480
+ return lazyConfigDiagnostics;
157481
+ },
157482
+ getCombinedDiagnostics(program2) {
157483
+ if (computedDiagnostics) {
157484
+ return computedDiagnostics;
157485
+ }
157486
+ computedDiagnostics = createDiagnosticCollection();
157487
+ configDiagnostics == null ? void 0 : configDiagnostics.getDiagnostics().forEach((d) => computedDiagnostics.add(d));
157488
+ fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
157489
+ switch (diagnostic.kind) {
157490
+ case 1:
157491
+ return computedDiagnostics.add(
157492
+ createDiagnosticExplainingFile(
157493
+ program2,
157494
+ diagnostic.file && program2.getSourceFileByPath(diagnostic.file),
157495
+ diagnostic.fileProcessingReason,
157496
+ diagnostic.diagnostic,
157497
+ diagnostic.args || emptyArray
157498
+ )
157499
+ );
157500
+ case 0:
157501
+ return computedDiagnostics.add(filePreprocessingLibreferenceDiagnostic(program2, diagnostic));
157502
+ case 2:
157503
+ return diagnostic.diagnostics.forEach((d) => computedDiagnostics.add(d));
157504
+ default:
157505
+ Debug.assertNever(diagnostic);
157506
+ }
157507
+ });
157508
+ lazyConfigDiagnostics == null ? void 0 : lazyConfigDiagnostics.forEach(
157509
+ ({ file, diagnostic, args }) => computedDiagnostics.add(
157510
+ createDiagnosticExplainingFile(
157511
+ program2,
157512
+ file,
157513
+ /*fileProcessingReason*/
157514
+ void 0,
157515
+ diagnostic,
157516
+ args
157517
+ )
157518
+ )
157519
+ );
157520
+ fileReasonsToChain = void 0;
157521
+ reasonToRelatedInfo = void 0;
157522
+ return computedDiagnostics;
157523
+ }
157524
+ };
157525
+ function filePreprocessingLibreferenceDiagnostic(program2, { reason }) {
157526
+ const { file, pos, end } = getReferencedFileLocation(program2, reason);
157527
+ const libReference = file.libReferenceDirectives[reason.index];
157528
+ const libName = getLibNameFromLibReference(libReference);
157529
+ const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
157530
+ const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
157531
+ return createFileDiagnostic(
157532
+ file,
157533
+ Debug.checkDefined(pos),
157534
+ Debug.checkDefined(end) - pos,
157535
+ suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
157536
+ libName,
157537
+ suggestion
157538
+ );
157539
+ }
157540
+ function createDiagnosticExplainingFile(program2, file, fileProcessingReason, diagnostic, args) {
157541
+ let seenReasons;
157542
+ let fileIncludeReasons;
157543
+ let relatedInfo;
157544
+ let fileIncludeReasonDetails;
157545
+ let redirectInfo;
157546
+ let chain;
157547
+ const reasons = file && fileReasons.get(file.path);
157548
+ let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
157549
+ let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
157550
+ if (cachedChain) {
157551
+ if (cachedChain.fileIncludeReasonDetails) {
157552
+ seenReasons = new Set(reasons);
157553
+ reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
157554
+ } else {
157555
+ reasons == null ? void 0 : reasons.forEach(processReason);
157556
+ }
157557
+ redirectInfo = cachedChain.redirectInfo;
157558
+ } else {
157559
+ reasons == null ? void 0 : reasons.forEach(processReason);
157560
+ redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program2.getCompilerOptionsForFile(file));
157561
+ }
157562
+ if (fileProcessingReason)
157563
+ processReason(fileProcessingReason);
157564
+ const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
157565
+ if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1)
157566
+ seenReasons = void 0;
157567
+ if (seenReasons && cachedChain) {
157568
+ if (cachedChain.details && !processedExtraReason) {
157569
+ chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args ?? emptyArray);
157570
+ } else if (cachedChain.fileIncludeReasonDetails) {
157571
+ if (!processedExtraReason) {
157572
+ if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
157573
+ fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
157574
+ } else {
157575
+ fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
157576
+ }
157577
+ } else {
157578
+ if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
157579
+ fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
157580
+ } else {
157581
+ fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
157582
+ }
157583
+ }
157584
+ }
157585
+ }
157586
+ if (!chain) {
157587
+ if (!fileIncludeReasonDetails)
157588
+ fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
157589
+ chain = chainDiagnosticMessages(
157590
+ redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
157591
+ diagnostic,
157592
+ ...args || emptyArray
157593
+ );
157594
+ }
157595
+ if (file) {
157596
+ if (cachedChain) {
157597
+ if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
157598
+ cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
157599
+ }
157600
+ } else {
157601
+ (fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
157602
+ }
157603
+ if (!cachedChain.details && !processedExtraReason)
157604
+ cachedChain.details = chain.next;
157605
+ }
157606
+ const location = locationReason && getReferencedFileLocation(program2, locationReason);
157607
+ return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
157608
+ function processReason(reason) {
157609
+ if (seenReasons == null ? void 0 : seenReasons.has(reason))
157610
+ return;
157611
+ (seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
157612
+ (fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program2, reason));
157613
+ populateRelatedInfo(reason);
157614
+ }
157615
+ function populateRelatedInfo(reason) {
157616
+ if (!locationReason && isReferencedFile(reason)) {
157617
+ locationReason = reason;
157618
+ } else if (locationReason !== reason) {
157619
+ relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(program2, reason));
157620
+ }
157621
+ }
157622
+ function cachedFileIncludeDetailsHasProcessedExtraReason() {
157623
+ var _a;
157624
+ return ((_a = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a.length) !== (reasons == null ? void 0 : reasons.length);
157625
+ }
157626
+ }
157627
+ function getFileIncludeReasonToRelatedInformation(program2, reason) {
157628
+ let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
157629
+ if (relatedInfo === void 0)
157630
+ (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(program2, reason) ?? false);
157631
+ return relatedInfo || void 0;
157632
+ }
157633
+ function fileIncludeReasonToRelatedInformation(program2, reason) {
157634
+ if (isReferencedFile(reason)) {
157635
+ const referenceLocation = getReferencedFileLocation(program2, reason);
157636
+ let message2;
157637
+ switch (reason.kind) {
157638
+ case 3:
157639
+ message2 = Diagnostics.File_is_included_via_import_here;
157640
+ break;
157641
+ case 4:
157642
+ message2 = Diagnostics.File_is_included_via_reference_here;
157643
+ break;
157644
+ case 5:
157645
+ message2 = Diagnostics.File_is_included_via_type_library_reference_here;
157646
+ break;
157647
+ case 7:
157648
+ message2 = Diagnostics.File_is_included_via_library_reference_here;
157649
+ break;
157650
+ default:
157651
+ Debug.assertNever(reason);
157652
+ }
157653
+ return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
157654
+ referenceLocation.file,
157655
+ referenceLocation.pos,
157656
+ referenceLocation.end - referenceLocation.pos,
157657
+ message2
157658
+ ) : void 0;
157659
+ }
157660
+ const currentDirectory = program2.getCurrentDirectory();
157661
+ const rootNames = program2.getRootFileNames();
157662
+ const options = program2.getCompilerOptions();
157663
+ if (!options.configFile)
157664
+ return void 0;
157665
+ let configFileNode;
157666
+ let message;
157667
+ switch (reason.kind) {
157668
+ case 0:
157669
+ if (!options.configFile.configFileSpecs)
157670
+ return void 0;
157671
+ const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
157672
+ const matchedByFiles = getMatchedFileSpec(program2, fileName);
157673
+ if (matchedByFiles) {
157674
+ configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
157675
+ message = Diagnostics.File_is_matched_by_files_list_specified_here;
157676
+ break;
157677
+ }
157678
+ const matchedByInclude = getMatchedIncludeSpec(program2, fileName);
157679
+ if (!matchedByInclude || !isString(matchedByInclude))
157680
+ return void 0;
157681
+ configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
157682
+ message = Diagnostics.File_is_matched_by_include_pattern_specified_here;
157683
+ break;
157684
+ case 1:
157685
+ case 2:
157686
+ const resolvedProjectReferences = program2.getResolvedProjectReferences();
157687
+ const projectReferences = program2.getProjectReferences();
157688
+ const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
157689
+ const referenceInfo = forEachProjectReference(
157690
+ projectReferences,
157691
+ resolvedProjectReferences,
157692
+ (resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
157693
+ );
157694
+ if (!referenceInfo)
157695
+ return void 0;
157696
+ const { sourceFile, index } = referenceInfo;
157697
+ const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
157698
+ return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
157699
+ sourceFile,
157700
+ referencesSyntax.elements[index],
157701
+ reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
157702
+ ) : void 0;
157703
+ case 8:
157704
+ if (!options.types)
157705
+ return void 0;
157706
+ configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "types", reason.typeReference);
157707
+ message = Diagnostics.File_is_entry_point_of_type_library_specified_here;
157708
+ break;
157709
+ case 6:
157710
+ if (reason.index !== void 0) {
157711
+ configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "lib", options.lib[reason.index]);
157712
+ message = Diagnostics.File_is_library_specified_here;
157713
+ break;
157714
+ }
157715
+ const target = getNameOfScriptTarget(getEmitScriptTarget(options));
157716
+ configFileNode = target ? getOptionsSyntaxByValue(getCompilerOptionsObjectLiteralSyntax(), "target", target) : void 0;
157717
+ message = Diagnostics.File_is_default_library_for_target_specified_here;
157718
+ break;
157719
+ default:
157720
+ Debug.assertNever(reason);
157721
+ }
157722
+ return configFileNode && createDiagnosticForNodeInSourceFile(
157723
+ options.configFile,
157724
+ configFileNode,
157725
+ message
157726
+ );
157727
+ }
157728
+ }
157295
157729
  function getFileEmitOutput(program2, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
157296
157730
  const outputFiles = [];
157297
157731
  const { emitSkipped, diagnostics } = program2.emit(sourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit);
@@ -165945,18 +166379,21 @@ ${lanes.join("\n")}
165945
166379
  return failed;
165946
166380
  }
165947
166381
  function typeFromFunctionLikeExpression(fnNode, context) {
165948
- const oldNoInferenceFallback = context.noInferenceFallback;
165949
- context.noInferenceFallback = true;
165950
- createReturnFromSignature(
166382
+ const returnType = createReturnFromSignature(
165951
166383
  fnNode,
165952
166384
  /*symbol*/
165953
166385
  void 0,
165954
166386
  context
165955
166387
  );
165956
- reuseTypeParameters(fnNode.typeParameters, context);
165957
- fnNode.parameters.map((p2) => ensureParameter(p2, context));
165958
- context.noInferenceFallback = oldNoInferenceFallback;
165959
- return notImplemented2;
166388
+ const typeParameters = reuseTypeParameters(fnNode.typeParameters, context);
166389
+ const parameters = fnNode.parameters.map((p2) => ensureParameter(p2, context));
166390
+ return syntacticResult(
166391
+ factory.createFunctionTypeNode(
166392
+ typeParameters,
166393
+ parameters,
166394
+ returnType
166395
+ )
166396
+ );
165960
166397
  }
165961
166398
  function canGetTypeFromArrayLiteral(arrayLiteral, context, isConstContext) {
165962
166399
  if (!isConstContext) {
@@ -169741,7 +170178,7 @@ ${lanes.join("\n")}
169741
170178
  return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target, forceCapitalize);
169742
170179
  }
169743
170180
  function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) {
169744
- const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
170181
+ const baseName = getBaseFileName(removeSuffix(removeFileExtension(moduleSpecifier), "/index"));
169745
170182
  let res = "";
169746
170183
  let lastCharWasValid = true;
169747
170184
  const firstCharCode = baseName.charCodeAt(0);
@@ -175991,7 +176428,7 @@ interface Symbol {
175991
176428
  const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
175992
176429
  for (const statement of toMove) {
175993
176430
  forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
175994
- if (!symbol.declarations) {
176431
+ if (!some(symbol.declarations)) {
175995
176432
  return;
175996
176433
  }
175997
176434
  if (existingTargetLocals.has(skipAlias(symbol, checker))) {
@@ -186884,6 +187321,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
186884
187321
  Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
186885
187322
  Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
186886
187323
  Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
187324
+ Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code,
186887
187325
  Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code
186888
187326
  ];
186889
187327
  registerCodeFix({
@@ -188020,6 +188458,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
188020
188458
  case 200:
188021
188459
  return 2;
188022
188460
  case 100:
188461
+ case 101:
188023
188462
  case 199:
188024
188463
  return getImpliedNodeFormatForEmit(importingFile, program2) === 99 ? 2 : 3;
188025
188464
  default:
@@ -189484,7 +189923,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
189484
189923
  Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,
189485
189924
  Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,
189486
189925
  Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
189487
- Diagnostics.Cannot_find_name_0.code
189926
+ Diagnostics.Cannot_find_name_0.code,
189927
+ Diagnostics.Type_0_does_not_satisfy_the_expected_type_1.code
189488
189928
  ];
189489
189929
  registerCodeFix({
189490
189930
  errorCodes: errorCodes28,
@@ -189521,9 +189961,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
189521
189961
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
189522
189962
  eachDiagnostic(context, errorCodes28, (diag2) => {
189523
189963
  const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
189524
- if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 ? info.identifier : info.token.text))) {
189964
+ if (info === void 0)
189965
+ return;
189966
+ const nodeId = getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 ? info.identifier || getNodeId(info.token) : info.token.text);
189967
+ if (!addToSeen(seen, nodeId))
189525
189968
  return;
189526
- }
189527
189969
  if (fixId56 === fixMissingFunctionDeclaration && (info.kind === 2 || info.kind === 5)) {
189528
189970
  addFunctionDeclaration(changes, context, info);
189529
189971
  } else if (fixId56 === fixMissingProperties && info.kind === 3) {
@@ -189576,7 +190018,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
189576
190018
  }
189577
190019
  });
189578
190020
  function getInfo10(sourceFile, tokenPos, errorCode, checker, program2) {
189579
- var _a, _b, _c;
190021
+ var _a, _b;
189580
190022
  const token = getTokenAtPosition(sourceFile, tokenPos);
189581
190023
  const parent2 = token.parent;
189582
190024
  if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
@@ -189603,25 +190045,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
189603
190045
  return void 0;
189604
190046
  return { kind: 3, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
189605
190047
  }
189606
- if (token.kind === 19 && isObjectLiteralExpression(parent2)) {
189607
- const targetType = (_a = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2)) == null ? void 0 : _a.getNonNullableType();
189608
- const properties = arrayFrom(checker.getUnmatchedProperties(
189609
- checker.getTypeAtLocation(parent2),
189610
- targetType,
189611
- /*requireOptionalProperties*/
189612
- false,
189613
- /*matchDiscriminantProperties*/
189614
- false
189615
- ));
189616
- if (!length(properties))
189617
- return void 0;
189618
- const identifier = "";
189619
- return { kind: 3, token: parent2, identifier, properties, parentDeclaration: parent2 };
190048
+ if (token.kind === 19 || isSatisfiesExpression(parent2) || isReturnStatement(parent2)) {
190049
+ const expression = (isSatisfiesExpression(parent2) || isReturnStatement(parent2)) && parent2.expression ? parent2.expression : parent2;
190050
+ if (isObjectLiteralExpression(expression)) {
190051
+ const targetType = isSatisfiesExpression(parent2) ? checker.getTypeFromTypeNode(parent2.type) : checker.getContextualType(expression) || checker.getTypeAtLocation(expression);
190052
+ const properties = arrayFrom(checker.getUnmatchedProperties(
190053
+ checker.getTypeAtLocation(parent2),
190054
+ targetType.getNonNullableType(),
190055
+ /*requireOptionalProperties*/
190056
+ false,
190057
+ /*matchDiscriminantProperties*/
190058
+ false
190059
+ ));
190060
+ if (!length(properties))
190061
+ return void 0;
190062
+ return { kind: 3, token: parent2, identifier: void 0, properties, parentDeclaration: expression, indentation: isReturnStatement(expression.parent) || isYieldExpression(expression.parent) ? 0 : void 0 };
190063
+ }
189620
190064
  }
189621
190065
  if (!isMemberName(token))
189622
190066
  return void 0;
189623
190067
  if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
189624
- const targetType = (_b = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _b.getNonNullableType();
190068
+ const targetType = (_a = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _a.getNonNullableType();
189625
190069
  const properties = arrayFrom(checker.getUnmatchedProperties(
189626
190070
  checker.getTypeAtLocation(parent2.initializer),
189627
190071
  targetType,
@@ -189642,7 +190086,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
189642
190086
  return { kind: 4, token, attributes, parentDeclaration: token.parent };
189643
190087
  }
189644
190088
  if (isIdentifier(token)) {
189645
- const type = (_c = checker.getContextualType(token)) == null ? void 0 : _c.getNonNullableType();
190089
+ const type = (_b = checker.getContextualType(token)) == null ? void 0 : _b.getNonNullableType();
189646
190090
  if (type && getObjectFlags(type) & 16) {
189647
190091
  const signature = firstOrUndefined(checker.getSignaturesOfType(
189648
190092
  type,
@@ -190710,9 +191154,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
190710
191154
  }
190711
191155
  registerCodeFix({
190712
191156
  errorCodes: [
190713
- Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
190714
- Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
190715
- Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
191157
+ Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
191158
+ Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
191159
+ Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
190716
191160
  ],
190717
191161
  getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
190718
191162
  const compilerOptions = context.program.getCompilerOptions();
@@ -191182,6 +191626,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
191182
191626
  break;
191183
191627
  } else if (canDeleteEntireVariableStatement(sourceFile, token)) {
191184
191628
  deleteEntireVariableStatement(changes, sourceFile, token.parent);
191629
+ } else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) {
191630
+ deleteFunctionLikeDeclaration(changes, sourceFile, token.parent);
191185
191631
  } else {
191186
191632
  tryDeleteDeclaration(
191187
191633
  sourceFile,
@@ -194308,12 +194754,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
194308
194754
  return typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget);
194309
194755
  }
194310
194756
  function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
194311
- if (typeNode && isImportTypeNode(typeNode)) {
194312
- const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
194313
- if (importableReference) {
194314
- importSymbols(importAdder, importableReference.symbols);
194315
- typeNode = importableReference.typeNode;
194316
- }
194757
+ const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
194758
+ if (importableReference) {
194759
+ importSymbols(importAdder, importableReference.symbols);
194760
+ typeNode = importableReference.typeNode;
194317
194761
  }
194318
194762
  return getSynthesizedDeepClone(typeNode);
194319
194763
  }
@@ -203247,7 +203691,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
203247
203691
  } else {
203248
203692
  addIfImplementation(body);
203249
203693
  }
203250
- } else if (isAssertionExpression(typeHavingNode)) {
203694
+ } else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) {
203251
203695
  addIfImplementation(typeHavingNode.expression);
203252
203696
  }
203253
203697
  }
@@ -203721,7 +204165,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
203721
204165
  const { parent: parent2 } = node;
203722
204166
  const typeChecker = program2.getTypeChecker();
203723
204167
  if (node.kind === 164 || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) {
203724
- return getDefinitionFromOverriddenMember(typeChecker, node) || emptyArray;
204168
+ const def = getDefinitionFromOverriddenMember(typeChecker, node);
204169
+ if (def !== void 0 || node.kind !== 164) {
204170
+ return def || emptyArray;
204171
+ }
203725
204172
  }
203726
204173
  if (isJumpStatementTarget(node)) {
203727
204174
  const label2 = getTargetLabel(node.parent, node.text);
@@ -203735,9 +204182,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
203735
204182
  )] : void 0;
203736
204183
  }
203737
204184
  switch (node.kind) {
203738
- case 107:
203739
- const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
203740
- return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
203741
204185
  case 90:
203742
204186
  if (!isDefaultClause(node.parent)) {
203743
204187
  break;
@@ -203749,19 +204193,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
203749
204193
  }
203750
204194
  break;
203751
204195
  }
203752
- if (node.kind === 135) {
203753
- const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
203754
- const isAsyncFunction2 = functionDeclaration && some(
203755
- functionDeclaration.modifiers,
203756
- (node2) => node2.kind === 134
203757
- /* AsyncKeyword */
203758
- );
203759
- return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
203760
- }
203761
- if (node.kind === 127) {
203762
- const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
203763
- const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
203764
- return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
204196
+ let findFunctionDecl;
204197
+ switch (node.kind) {
204198
+ case 107:
204199
+ case 135:
204200
+ case 127:
204201
+ findFunctionDecl = isFunctionLikeDeclaration;
204202
+ const functionDeclaration = findAncestor(node, findFunctionDecl);
204203
+ return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
203765
204204
  }
203766
204205
  if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
203767
204206
  const classDecl = node.parent.parent;
@@ -203811,6 +204250,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
203811
204250
  }];
203812
204251
  }
203813
204252
  }
204253
+ if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) {
204254
+ symbol = parent2.symbol;
204255
+ }
203814
204256
  if (!symbol) {
203815
204257
  return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker));
203816
204258
  }
@@ -204014,12 +204456,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
204014
204456
  false
204015
204457
  );
204016
204458
  }
204017
- const { symbol, failedAliasResolution } = getSymbol(
204459
+ let { symbol, failedAliasResolution } = getSymbol(
204018
204460
  node,
204019
204461
  typeChecker,
204020
204462
  /*stopAtAlias*/
204021
204463
  false
204022
204464
  );
204465
+ if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) {
204466
+ symbol = node.parent.symbol;
204467
+ failedAliasResolution = false;
204468
+ }
204023
204469
  if (!symbol)
204024
204470
  return void 0;
204025
204471
  const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
@@ -204532,22 +204978,26 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
204532
204978
  if (!signature) {
204533
204979
  return;
204534
204980
  }
204535
- for (let i = 0; i < node.parameters.length && i < signature.parameters.length; ++i) {
204536
- const param = node.parameters[i];
204537
- if (!isHintableDeclaration(param)) {
204538
- continue;
204539
- }
204540
- const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(param);
204541
- if (effectiveTypeAnnotation) {
204542
- continue;
204981
+ let pos = 0;
204982
+ for (const param of node.parameters) {
204983
+ if (isHintableDeclaration(param)) {
204984
+ addParameterTypeHint(param, parameterIsThisKeyword(param) ? signature.thisParameter : signature.parameters[pos]);
204543
204985
  }
204544
- const typeHints = getParameterDeclarationTypeHints(signature.parameters[i]);
204545
- if (!typeHints) {
204986
+ if (parameterIsThisKeyword(param)) {
204546
204987
  continue;
204547
204988
  }
204548
- addTypeHints(typeHints, param.questionToken ? param.questionToken.end : param.name.end);
204989
+ pos++;
204549
204990
  }
204550
204991
  }
204992
+ function addParameterTypeHint(node, symbol) {
204993
+ const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(node);
204994
+ if (effectiveTypeAnnotation || symbol === void 0)
204995
+ return;
204996
+ const typeHints = getParameterDeclarationTypeHints(symbol);
204997
+ if (typeHints === void 0)
204998
+ return;
204999
+ addTypeHints(typeHints, node.questionToken ? node.questionToken.end : node.name.end);
205000
+ }
204551
205001
  function getParameterDeclarationTypeHints(symbol) {
204552
205002
  const valueDeclaration = symbol.valueDeclaration;
204553
205003
  if (!valueDeclaration || !isParameter(valueDeclaration)) {
@@ -214459,6 +214909,7 @@ ${options.prefix}` : "\n" : options.prefix
214459
214909
  createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
214460
214910
  createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
214461
214911
  createProgram: () => createProgram,
214912
+ createProgramDiagnostics: () => createProgramDiagnostics,
214462
214913
  createProgramHost: () => createProgramHost,
214463
214914
  createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
214464
214915
  createQueue: () => createQueue,
@@ -214628,6 +215079,8 @@ ${options.prefix}` : "\n" : options.prefix
214628
215079
  forEachLeadingCommentRange: () => forEachLeadingCommentRange,
214629
215080
  forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
214630
215081
  forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
215082
+ forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
215083
+ forEachProjectReference: () => forEachProjectReference,
214631
215084
  forEachPropertyAssignment: () => forEachPropertyAssignment,
214632
215085
  forEachResolvedProjectReference: () => forEachResolvedProjectReference,
214633
215086
  forEachReturnStatement: () => forEachReturnStatement,
@@ -214867,6 +215320,8 @@ ${options.prefix}` : "\n" : options.prefix
214867
215320
  getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
214868
215321
  getLeftmostAccessExpression: () => getLeftmostAccessExpression,
214869
215322
  getLeftmostExpression: () => getLeftmostExpression,
215323
+ getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
215324
+ getLibNameFromLibReference: () => getLibNameFromLibReference,
214870
215325
  getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
214871
215326
  getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
214872
215327
  getLineInfo: () => getLineInfo,
@@ -214939,6 +215394,8 @@ ${options.prefix}` : "\n" : options.prefix
214939
215394
  getOptionFromName: () => getOptionFromName,
214940
215395
  getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
214941
215396
  getOptionsNameMap: () => getOptionsNameMap,
215397
+ getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
215398
+ getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
214942
215399
  getOrCreateEmitNode: () => getOrCreateEmitNode,
214943
215400
  getOrUpdate: () => getOrUpdate,
214944
215401
  getOriginalNode: () => getOriginalNode,
@@ -214975,7 +215432,6 @@ ${options.prefix}` : "\n" : options.prefix
214975
215432
  getPrivateIdentifier: () => getPrivateIdentifier,
214976
215433
  getProperties: () => getProperties,
214977
215434
  getProperty: () => getProperty,
214978
- getPropertyArrayElementValue: () => getPropertyArrayElementValue,
214979
215435
  getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
214980
215436
  getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
214981
215437
  getPropertyNameFromType: () => getPropertyNameFromType,
@@ -215886,6 +216342,7 @@ ${options.prefix}` : "\n" : options.prefix
215886
216342
  moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
215887
216343
  moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
215888
216344
  moduleSpecifiers: () => ts_moduleSpecifiers_exports,
216345
+ moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
215889
216346
  moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
215890
216347
  moveEmitHelpers: () => moveEmitHelpers,
215891
216348
  moveRangeEnd: () => moveRangeEnd,
@@ -217255,6 +217712,7 @@ ${options.prefix}` : "\n" : options.prefix
217255
217712
  ModuleKind3["ES2022"] = "es2022";
217256
217713
  ModuleKind3["ESNext"] = "esnext";
217257
217714
  ModuleKind3["Node16"] = "node16";
217715
+ ModuleKind3["Node18"] = "node18";
217258
217716
  ModuleKind3["NodeNext"] = "nodenext";
217259
217717
  ModuleKind3["Preserve"] = "preserve";
217260
217718
  return ModuleKind3;
@@ -227881,20 +228339,19 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
227881
228339
  try {
227882
228340
  codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
227883
228341
  } catch (e) {
228342
+ const error22 = e instanceof Error ? e : new Error(e);
227884
228343
  const ls = project.getLanguageService();
227885
228344
  const existingDiagCodes = [
227886
228345
  ...ls.getSyntacticDiagnostics(file),
227887
228346
  ...ls.getSemanticDiagnostics(file),
227888
228347
  ...ls.getSuggestionDiagnostics(file)
227889
- ].map(
227890
- (d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code
227891
- );
228348
+ ].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code);
227892
228349
  const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c));
227893
228350
  if (badCode !== void 0) {
227894
- e.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error:
227895
- ${e.message}`;
228351
+ error22.message += `
228352
+ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
227896
228353
  }
227897
- throw e;
228354
+ throw error22;
227898
228355
  }
227899
228356
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
227900
228357
  }