@typescript-deploys/pr-build 4.6.0-pr-47050-2 → 4.6.0-pr-47078-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-insiders.20211208";
103
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211209";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -24438,7 +24438,7 @@ var ts;
24438
24438
  // @api
24439
24439
  function createAssertClause(elements, multiLine) {
24440
24440
  var node = createBaseNode(292 /* AssertClause */);
24441
- node.elements = elements;
24441
+ node.elements = createNodeArray(elements);
24442
24442
  node.multiLine = multiLine;
24443
24443
  node.transformFlags |= 4 /* ContainsESNext */;
24444
24444
  return node;
@@ -54059,7 +54059,27 @@ var ts;
54059
54059
  return mapType(source, function (t) { return getRestType(t, properties, symbol); });
54060
54060
  }
54061
54061
  var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
54062
+ var spreadableProperties = [];
54063
+ var unspreadableToRestKeys = [];
54064
+ for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
54065
+ var prop = _a[_i];
54066
+ var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
54067
+ if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
54068
+ && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
54069
+ && isSpreadableProperty(prop)) {
54070
+ spreadableProperties.push(prop);
54071
+ }
54072
+ else {
54073
+ unspreadableToRestKeys.push(literalTypeFromProperty);
54074
+ }
54075
+ }
54062
54076
  if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
54077
+ if (unspreadableToRestKeys.length) {
54078
+ // If the type we're spreading from has properties that cannot
54079
+ // be spread into the rest type (e.g. getters, methods), ensure
54080
+ // they are explicitly omitted, as they would in the non-generic case.
54081
+ omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
54082
+ }
54063
54083
  if (omitKeyType.flags & 131072 /* Never */) {
54064
54084
  return source;
54065
54085
  }
@@ -54070,13 +54090,9 @@ var ts;
54070
54090
  return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
54071
54091
  }
54072
54092
  var members = ts.createSymbolTable();
54073
- for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
54074
- var prop = _a[_i];
54075
- if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), omitKeyType)
54076
- && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
54077
- && isSpreadableProperty(prop)) {
54078
- members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54079
- }
54093
+ for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
54094
+ var prop = spreadableProperties_1[_b];
54095
+ members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54080
54096
  }
54081
54097
  var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
54082
54098
  result.objectFlags |= 8388608 /* ObjectRestType */;
@@ -57332,7 +57348,7 @@ var ts;
57332
57348
  }
57333
57349
  if (t.flags & 268435456 /* StringMapping */) {
57334
57350
  var constraint = getBaseConstraint(t.type);
57335
- return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
57351
+ return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
57336
57352
  }
57337
57353
  if (t.flags & 8388608 /* IndexedAccess */) {
57338
57354
  var baseObjectType = getBaseConstraint(t.objectType);
@@ -60203,12 +60219,9 @@ var ts;
60203
60219
  }
60204
60220
  function getStringMappingType(symbol, type) {
60205
60221
  return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
60206
- // Mapping<Mapping<T>> === Mapping<T>
60207
- type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
60208
- isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
60209
- type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60210
- type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
60211
- type;
60222
+ isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
60223
+ type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60224
+ type;
60212
60225
  }
60213
60226
  function applyStringMapping(symbol, str) {
60214
60227
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -60219,15 +60232,6 @@ var ts;
60219
60232
  }
60220
60233
  return str;
60221
60234
  }
60222
- function applyTemplateStringMapping(symbol, texts, types) {
60223
- switch (intrinsicTypeKinds.get(symbol.escapedName)) {
60224
- case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60225
- case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60226
- case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60227
- case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60228
- }
60229
- return [texts, types];
60230
- }
60231
60235
  function getStringMappingTypeForGenericType(symbol, type) {
60232
60236
  var id = getSymbolId(symbol) + "," + getTypeId(type);
60233
60237
  var result = stringMappingTypes.get(id);
@@ -60469,7 +60473,7 @@ var ts;
60469
60473
  accessNode;
60470
60474
  }
60471
60475
  function isPatternLiteralPlaceholderType(type) {
60472
- return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
60476
+ return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
60473
60477
  }
60474
60478
  function isPatternLiteralType(type) {
60475
60479
  return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
@@ -64068,13 +64072,6 @@ var ts;
64068
64072
  return -1 /* True */;
64069
64073
  }
64070
64074
  }
64071
- else if (target.flags & 268435456 /* StringMapping */) {
64072
- if (!(source.flags & 268435456 /* StringMapping */)) {
64073
- if (isUnchangedByStringMapping(target.symbol, source)) {
64074
- return -1 /* True */;
64075
- }
64076
- }
64077
- }
64078
64075
  if (source.flags & 8650752 /* TypeVariable */) {
64079
64076
  // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
64080
64077
  if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
@@ -64114,10 +64111,7 @@ var ts;
64114
64111
  }
64115
64112
  }
64116
64113
  else if (source.flags & 268435456 /* StringMapping */) {
64117
- if (target.flags & 268435456 /* StringMapping */) {
64118
- if (source.symbol !== target.symbol) {
64119
- return 0 /* False */;
64120
- }
64114
+ if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
64121
64115
  if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
64122
64116
  resetErrorInfo(saveErrorInfo);
64123
64117
  return result;
@@ -65012,7 +65006,7 @@ var ts;
65012
65006
  return typeCouldHaveTopLevelSingletonTypes(constraint);
65013
65007
  }
65014
65008
  }
65015
- return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
65009
+ return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
65016
65010
  }
65017
65011
  function getExactOptionalUnassignableProperties(source, target) {
65018
65012
  if (isTupleType(source) && isTupleType(target))
@@ -66425,9 +66419,6 @@ var ts;
66425
66419
  // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
66426
66420
  return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);
66427
66421
  }
66428
- function isUnchangedByStringMapping(symbol, value) {
66429
- return value === getStringMappingType(symbol, value);
66430
- }
66431
66422
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
66432
66423
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
66433
66424
  return true;
@@ -66436,8 +66427,7 @@ var ts;
66436
66427
  var value = source.value;
66437
66428
  return !!(target.flags & 8 /* Number */ && value !== "" && isFinite(+value) ||
66438
66429
  target.flags & 64 /* BigInt */ && value !== "" && isValidBigIntString(value) ||
66439
- target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
66440
- target.flags & 268435456 /* StringMapping */ && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
66430
+ target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName);
66441
66431
  }
66442
66432
  if (source.flags & 134217728 /* TemplateLiteral */) {
66443
66433
  var texts = source.texts;
@@ -74369,7 +74359,7 @@ var ts;
74369
74359
  typeArguments.pop();
74370
74360
  }
74371
74361
  while (typeArguments.length < typeParameters.length) {
74372
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74362
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74373
74363
  }
74374
74364
  return typeArguments;
74375
74365
  }
@@ -75025,8 +75015,7 @@ var ts;
75025
75015
  */
75026
75016
  function checkCallExpression(node, checkMode) {
75027
75017
  var _a;
75028
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75029
- checkGrammarArguments(node.arguments);
75018
+ checkGrammarTypeArguments(node, node.typeArguments);
75030
75019
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75031
75020
  if (signature === resolvingSignature) {
75032
75021
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75131,8 +75120,7 @@ var ts;
75131
75120
  }
75132
75121
  function checkImportCallExpression(node) {
75133
75122
  // Check grammar of dynamic import
75134
- if (!checkGrammarArguments(node.arguments))
75135
- checkGrammarImportCallExpression(node);
75123
+ checkGrammarImportCallExpression(node);
75136
75124
  if (node.arguments.length === 0) {
75137
75125
  return createPromiseReturnType(node, anyType);
75138
75126
  }
@@ -85793,20 +85781,6 @@ var ts;
85793
85781
  }
85794
85782
  return false;
85795
85783
  }
85796
- function checkGrammarForOmittedArgument(args) {
85797
- if (args) {
85798
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85799
- var arg = args_4[_i];
85800
- if (arg.kind === 226 /* OmittedExpression */) {
85801
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85802
- }
85803
- }
85804
- }
85805
- return false;
85806
- }
85807
- function checkGrammarArguments(args) {
85808
- return checkGrammarForOmittedArgument(args);
85809
- }
85810
85784
  function checkGrammarHeritageClause(node) {
85811
85785
  var types = node.types;
85812
85786
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103054,7 +103028,7 @@ var ts;
103054
103028
  if (ts.isIdentifier(node.expression)) {
103055
103029
  var expression = substituteExpressionIdentifier(node.expression);
103056
103030
  noSubstitution[ts.getNodeId(expression)] = true;
103057
- if (!ts.isIdentifier(expression)) {
103031
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103058
103032
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103059
103033
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103060
103034
  }
@@ -103065,7 +103039,7 @@ var ts;
103065
103039
  if (ts.isIdentifier(node.tag)) {
103066
103040
  var tag = substituteExpressionIdentifier(node.tag);
103067
103041
  noSubstitution[ts.getNodeId(tag)] = true;
103068
- if (!ts.isIdentifier(tag)) {
103042
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103069
103043
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103070
103044
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103071
103045
  }
@@ -113691,6 +113665,7 @@ var ts;
113691
113665
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113692
113666
  /** @internal */
113693
113667
  ts.plainJSErrors = new ts.Set([
113668
+ // binder errors
113694
113669
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113695
113670
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113696
113671
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113706,6 +113681,81 @@ var ts;
113706
113681
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113707
113682
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113708
113683
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
113684
+ // grammar errors
113685
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
113686
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
113687
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
113688
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
113689
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
113690
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
113691
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113692
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113693
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
113694
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
113695
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
113696
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
113697
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
113698
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
113699
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
113700
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
113701
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
113702
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
113703
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
113704
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
113705
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
113706
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
113707
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
113708
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
113709
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
113710
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
113711
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
113712
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
113713
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
113714
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
113715
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
113716
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
113717
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
113718
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
113719
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
113720
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
113721
+ 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,
113722
+ ts.Diagnostics.Duplicate_label_0.code,
113723
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
113724
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
113725
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
113726
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
113727
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
113728
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
113729
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
113730
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
113731
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
113732
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
113733
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
113734
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
113735
+ 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,
113736
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
113737
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
113738
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
113739
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
113740
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
113741
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
113742
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
113743
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
113744
+ ts.Diagnostics._0_expected.code,
113745
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
113746
+ ts.Diagnostics._0_list_cannot_be_empty.code,
113747
+ ts.Diagnostics._0_modifier_already_seen.code,
113748
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
113749
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
113750
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
113751
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
113752
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
113753
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
113754
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
113755
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
113756
+ ts.Diagnostics.extends_clause_already_seen.code,
113757
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
113758
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
113709
113759
  ]);
113710
113760
  /**
113711
113761
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114735,9 +114785,10 @@ var ts;
114735
114785
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114736
114786
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114737
114787
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114738
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114788
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114739
114789
  if (isPlainJs) {
114740
114790
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114791
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114741
114792
  }
114742
114793
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114743
114794
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);