typescript 4.6.0-dev.20211205 → 4.6.0-dev.20211209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/lib.es5.d.ts CHANGED
@@ -1515,7 +1515,7 @@ interface Promise<T> {
1515
1515
  type Awaited<T> =
1516
1516
  T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1517
1517
  T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1518
- F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument
1518
+ F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
1519
1519
  Awaited<V> : // recursively unwrap the value
1520
1520
  never : // the argument to `then` was not callable
1521
1521
  T; // non-object or non-thenable
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20211205";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -5151,7 +5151,7 @@ var ts;
5151
5151
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
5152
5152
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
5153
5153
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
5154
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
5154
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
5155
5155
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
5156
5156
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
5157
5157
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -6103,6 +6103,7 @@ var ts;
6103
6103
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
6104
6104
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
6105
6105
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
6106
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
6106
6107
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
6107
6108
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
6108
6109
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -6296,6 +6297,9 @@ var ts;
6296
6297
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
6297
6298
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6298
6299
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6300
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6301
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6302
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6299
6303
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6300
6304
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
6301
6305
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -19674,7 +19678,7 @@ var ts;
19674
19678
  }
19675
19679
  function createAssertClause(elements, multiLine) {
19676
19680
  var node = createBaseNode(292);
19677
- node.elements = elements;
19681
+ node.elements = createNodeArray(elements);
19678
19682
  node.multiLine = multiLine;
19679
19683
  node.transformFlags |= 4;
19680
19684
  return node;
@@ -27083,7 +27087,11 @@ var ts;
27083
27087
  if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
27084
27088
  return undefined;
27085
27089
  }
27086
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
27090
+ var unwrappedType = type;
27091
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
27092
+ unwrappedType = unwrappedType.type;
27093
+ }
27094
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
27087
27095
  if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
27088
27096
  return undefined;
27089
27097
  }
@@ -36827,10 +36835,6 @@ var ts;
36827
36835
  seen.set(identifier.escapedText, currentKind);
36828
36836
  continue;
36829
36837
  }
36830
- if (currentKind === 1 && existingKind === 1) {
36831
- var span = ts.getErrorSpanForNode(file, identifier);
36832
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
36833
- }
36834
36838
  }
36835
36839
  }
36836
36840
  return bindAnonymousDeclaration(node, 4096, "__object");
@@ -37035,7 +37039,7 @@ var ts;
37035
37039
  }
37036
37040
  }
37037
37041
  function checkStrictModeNumericLiteral(node) {
37038
- if (inStrictMode && node.numericLiteralFlags & 32) {
37042
+ if (languageVersion < 1 && inStrictMode && node.numericLiteralFlags & 32) {
37039
37043
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
37040
37044
  }
37041
37045
  }
@@ -40032,7 +40036,8 @@ var ts;
40032
40036
  }
40033
40037
  }
40034
40038
  function isSameScopeDescendentOf(initial, parent, stopAt) {
40035
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
40039
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
40040
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
40036
40041
  }
40037
40042
  function getAnyImportSyntax(node) {
40038
40043
  switch (node.kind) {
@@ -54666,7 +54671,7 @@ var ts;
54666
54671
  }
54667
54672
  function getBaseTypeOfLiteralType(type) {
54668
54673
  return type.flags & 1024 ? getBaseTypeOfEnumLiteralType(type) :
54669
- type.flags & 128 ? stringType :
54674
+ type.flags & (128 | 134217728 | 268435456) ? stringType :
54670
54675
  type.flags & 256 ? numberType :
54671
54676
  type.flags & 2048 ? bigintType :
54672
54677
  type.flags & 512 ? booleanType :
@@ -62128,7 +62133,7 @@ var ts;
62128
62133
  typeArguments.pop();
62129
62134
  }
62130
62135
  while (typeArguments.length < typeParameters.length) {
62131
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62136
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62132
62137
  }
62133
62138
  return typeArguments;
62134
62139
  }
@@ -62674,8 +62679,7 @@ var ts;
62674
62679
  }
62675
62680
  function checkCallExpression(node, checkMode) {
62676
62681
  var _a;
62677
- if (!checkGrammarTypeArguments(node, node.typeArguments))
62678
- checkGrammarArguments(node.arguments);
62682
+ checkGrammarTypeArguments(node, node.typeArguments);
62679
62683
  var signature = getResolvedSignature(node, undefined, checkMode);
62680
62684
  if (signature === resolvingSignature) {
62681
62685
  return nonInferrableType;
@@ -62772,8 +62776,7 @@ var ts;
62772
62776
  return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
62773
62777
  }
62774
62778
  function checkImportCallExpression(node) {
62775
- if (!checkGrammarArguments(node.arguments))
62776
- checkGrammarImportCallExpression(node);
62779
+ checkGrammarImportCallExpression(node);
62777
62780
  if (node.arguments.length === 0) {
62778
62781
  return createPromiseReturnType(node, anyType);
62779
62782
  }
@@ -72056,20 +72059,6 @@ var ts;
72056
72059
  }
72057
72060
  return false;
72058
72061
  }
72059
- function checkGrammarForOmittedArgument(args) {
72060
- if (args) {
72061
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
72062
- var arg = args_4[_i];
72063
- if (arg.kind === 226) {
72064
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
72065
- }
72066
- }
72067
- }
72068
- return false;
72069
- }
72070
- function checkGrammarArguments(args) {
72071
- return checkGrammarForOmittedArgument(args);
72072
- }
72073
72062
  function checkGrammarHeritageClause(node) {
72074
72063
  var types = node.types;
72075
72064
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -72226,9 +72215,12 @@ var ts;
72226
72215
  seen.set(effectiveName, currentKind);
72227
72216
  }
72228
72217
  else {
72229
- if ((currentKind & 12) && (existingKind & 12)) {
72218
+ if ((currentKind & 8) && (existingKind & 8)) {
72230
72219
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
72231
72220
  }
72221
+ else if ((currentKind & 4) && (existingKind & 4)) {
72222
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
72223
+ }
72232
72224
  else if ((currentKind & 3) && (existingKind & 3)) {
72233
72225
  if (existingKind !== 3 && currentKind !== existingKind) {
72234
72226
  seen.set(effectiveName, currentKind | existingKind);
@@ -84637,7 +84629,7 @@ var ts;
84637
84629
  if (ts.isIdentifier(node.expression)) {
84638
84630
  var expression = substituteExpressionIdentifier(node.expression);
84639
84631
  noSubstitution[ts.getNodeId(expression)] = true;
84640
- if (!ts.isIdentifier(expression)) {
84632
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
84641
84633
  return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
84642
84634
  }
84643
84635
  }
@@ -84647,7 +84639,7 @@ var ts;
84647
84639
  if (ts.isIdentifier(node.tag)) {
84648
84640
  var tag = substituteExpressionIdentifier(node.tag);
84649
84641
  noSubstitution[ts.getNodeId(tag)] = true;
84650
- if (!ts.isIdentifier(tag)) {
84642
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
84651
84643
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
84652
84644
  }
84653
84645
  }
@@ -93742,6 +93734,80 @@ var ts;
93742
93734
  ts.Diagnostics.A_label_is_not_allowed_here.code,
93743
93735
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
93744
93736
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
93737
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
93738
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
93739
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
93740
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
93741
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
93742
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
93743
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93744
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93745
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
93746
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
93747
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
93748
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
93749
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
93750
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
93751
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
93752
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
93753
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
93754
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
93755
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
93756
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
93757
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
93758
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
93759
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
93760
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
93761
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
93762
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
93763
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
93764
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
93765
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
93766
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
93767
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
93768
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
93769
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
93770
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
93771
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
93772
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
93773
+ ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
93774
+ ts.Diagnostics.Duplicate_label_0.code,
93775
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
93776
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
93777
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
93778
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
93779
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
93780
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
93781
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
93782
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
93783
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
93784
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
93785
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
93786
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
93787
+ ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
93788
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
93789
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
93790
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
93791
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
93792
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
93793
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
93794
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
93795
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
93796
+ ts.Diagnostics._0_expected.code,
93797
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
93798
+ ts.Diagnostics._0_list_cannot_be_empty.code,
93799
+ ts.Diagnostics._0_modifier_already_seen.code,
93800
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
93801
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
93802
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
93803
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
93804
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
93805
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
93806
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
93807
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
93808
+ ts.Diagnostics.extends_clause_already_seen.code,
93809
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
93810
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
93745
93811
  ]);
93746
93812
  function shouldProgramCreateNewSourceFiles(program, newOptions) {
93747
93813
  if (!program)
@@ -94597,9 +94663,10 @@ var ts;
94597
94663
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
94598
94664
  || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
94599
94665
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
94600
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94666
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94601
94667
  if (isPlainJs) {
94602
94668
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94669
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94603
94670
  }
94604
94671
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
94605
94672
  });
@@ -99009,19 +99076,74 @@ var ts;
99009
99076
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
99010
99077
  }
99011
99078
  ts.getErrorCountForSummary = getErrorCountForSummary;
99079
+ function getFilesInErrorForSummary(diagnostics) {
99080
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
99081
+ .map(function (errorDiagnostic) {
99082
+ if (errorDiagnostic.file === undefined)
99083
+ return;
99084
+ return "" + errorDiagnostic.file.fileName;
99085
+ });
99086
+ return filesInError.map(function (fileName) {
99087
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
99088
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
99089
+ });
99090
+ if (diagnosticForFileName !== undefined) {
99091
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
99092
+ return {
99093
+ fileName: fileName,
99094
+ line: line + 1,
99095
+ };
99096
+ }
99097
+ });
99098
+ }
99099
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
99012
99100
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
99013
99101
  return errorCount === 1 ?
99014
99102
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
99015
99103
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99016
99104
  }
99017
99105
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99018
- function getErrorSummaryText(errorCount, newLine) {
99106
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
99019
99107
  if (errorCount === 0)
99020
99108
  return "";
99021
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
99022
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
99109
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99110
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99111
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
99112
+ var d = errorCount === 1 ?
99113
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99114
+ ts.Diagnostics.Found_1_error_in_1 :
99115
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99116
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99117
+ ts.Diagnostics.Found_0_errors :
99118
+ distinctFileNamesWithLines.length === 1 ?
99119
+ ts.Diagnostics.Found_0_errors_in_1_file :
99120
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99121
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99023
99122
  }
99024
99123
  ts.getErrorSummaryText = getErrorSummaryText;
99124
+ function createTabularErrorsDisplay(filesInError) {
99125
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99126
+ if (distinctFiles.length === 0)
99127
+ return "";
99128
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
99129
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
99130
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
99131
+ var headerRow = ts.Diagnostics.Errors_Files.message;
99132
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
99133
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
99134
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
99135
+ var tabularData = "";
99136
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
99137
+ fileToErrorCount.forEach(function (row) {
99138
+ var file = row[0], errorCount = row[1];
99139
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
99140
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99141
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99142
+ : "";
99143
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99144
+ });
99145
+ return tabularData;
99146
+ }
99025
99147
  function isBuilderProgram(program) {
99026
99148
  return !!program.getState;
99027
99149
  }
@@ -99210,7 +99332,7 @@ var ts;
99210
99332
  listFiles(program, write);
99211
99333
  }
99212
99334
  if (reportSummary) {
99213
- reportSummary(getErrorCountForSummary(diagnostics));
99335
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
99214
99336
  }
99215
99337
  return {
99216
99338
  emitResult: emitResult,
@@ -99400,7 +99522,7 @@ var ts;
99400
99522
  var system = input.system || ts.sys;
99401
99523
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99402
99524
  var builderProgram = ts.createIncrementalProgram(input);
99403
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
99525
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99404
99526
  if (input.afterProgramEmitAndDiagnostics)
99405
99527
  input.afterProgramEmitAndDiagnostics(builderProgram);
99406
99528
  return exitStatus;
@@ -101458,11 +101580,14 @@ var ts;
101458
101580
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
101459
101581
  var diagnostics = state.diagnostics;
101460
101582
  var totalErrors = 0;
101583
+ var filesInError = [];
101461
101584
  if (isCircularBuildOrder(buildOrder)) {
101462
101585
  reportBuildQueue(state, buildOrder.buildOrder);
101463
101586
  reportErrors(state, buildOrder.circularDiagnostics);
101464
101587
  if (canReportSummary)
101465
101588
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
101589
+ if (canReportSummary)
101590
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
101466
101591
  }
101467
101592
  else {
101468
101593
  buildOrder.forEach(function (project) {
@@ -101473,12 +101598,14 @@ var ts;
101473
101598
  });
101474
101599
  if (canReportSummary)
101475
101600
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
101601
+ if (canReportSummary)
101602
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
101476
101603
  }
101477
101604
  if (state.watch) {
101478
101605
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
101479
101606
  }
101480
101607
  else if (state.host.reportErrorSummary) {
101481
- state.host.reportErrorSummary(totalErrors);
101608
+ state.host.reportErrorSummary(totalErrors, filesInError);
101482
101609
  }
101483
101610
  }
101484
101611
  function reportBuildQueue(state, buildQueue) {
@@ -102105,7 +102232,7 @@ var ts;
102105
102232
  }
102106
102233
  function createReportErrorSummary(sys, options) {
102107
102234
  return shouldBePretty(sys, options) ?
102108
- function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
102235
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102109
102236
  undefined;
102110
102237
  }
102111
102238
  function performCompilation(sys, cb, reportDiagnostic, config) {