typescript 4.5.0-dev.20211029 → 4.6.0-dev.20211102

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.
@@ -85,11 +85,11 @@ var ts;
85
85
  (function (ts) {
86
86
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
87
87
  // If changing the text in this section, be sure to test `configurePrerelease` too.
88
- ts.versionMajorMinor = "4.5";
88
+ ts.versionMajorMinor = "4.6";
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211029";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211102";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -5115,7 +5115,7 @@ var ts;
5115
5115
  (function (ModuleResolutionKind) {
5116
5116
  ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
5117
5117
  ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
5118
- // Starting with node12, node's module resolver has significant departures from tranditional cjs resolution
5118
+ // Starting with node12, node's module resolver has significant departures from traditional cjs resolution
5119
5119
  // to better support ecmascript modules and their use within node - more features are still being added, so
5120
5120
  // we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12`
5121
5121
  // version-anchored resolution target
@@ -8693,6 +8693,8 @@ var ts;
8693
8693
  Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
8694
8694
  Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
8695
8695
  Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
8696
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "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 'node12' or 'nodenext'. Consider adding an extension to the import path."),
8697
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "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 'node12' or 'nodenext'. Did you mean '{0}'?"),
8696
8698
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
8697
8699
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "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}'."),
8698
8700
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "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}'."),
@@ -8799,6 +8801,7 @@ var ts;
8799
8801
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
8800
8802
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
8801
8803
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
8804
+ 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, ts.DiagnosticCategory.Error, "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'."),
8802
8805
  The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
8803
8806
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
8804
8807
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -9456,6 +9459,7 @@ var ts;
9456
9459
  Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
9457
9460
  Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
9458
9461
  Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
9462
+ Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
9459
9463
  Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
9460
9464
  Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
9461
9465
  Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -47357,6 +47361,21 @@ var ts;
47357
47361
  var enumRelation = new ts.Map();
47358
47362
  var builtinGlobals = ts.createSymbolTable();
47359
47363
  builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
47364
+ // Extensions suggested for path imports when module resolution is node12 or higher.
47365
+ // The first element of each tuple is the extension a file has.
47366
+ // The second element of each tuple is the extension that should be used in a path import.
47367
+ // e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
47368
+ var suggestedExtensions = [
47369
+ [".mts", ".mjs"],
47370
+ [".ts", ".js"],
47371
+ [".cts", ".cjs"],
47372
+ [".mjs", ".mjs"],
47373
+ [".js", ".js"],
47374
+ [".cjs", ".cjs"],
47375
+ [".tsx", compilerOptions.jsx === 1 /* Preserve */ ? ".jsx" : ".js"],
47376
+ [".jsx", ".jsx"],
47377
+ [".json", ".json"],
47378
+ ];
47360
47379
  initializeTypeChecker();
47361
47380
  return checker;
47362
47381
  function getJsxNamespace(location) {
@@ -49572,7 +49591,7 @@ var ts;
49572
49591
  : undefined;
49573
49592
  }
49574
49593
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
49575
- var _a, _b, _c, _d, _e, _f;
49594
+ var _a, _b, _c, _d, _e, _f, _g;
49576
49595
  if (isForAugmentation === void 0) { isForAugmentation = false; }
49577
49596
  if (ts.startsWith(moduleReference, "@types/")) {
49578
49597
  var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
@@ -49593,7 +49612,7 @@ var ts;
49593
49612
  ((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
49594
49613
  ((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
49595
49614
  var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
49596
- var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode); // TODO: GH#18217
49615
+ var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
49597
49616
  var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
49598
49617
  var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
49599
49618
  if (sourceFile) {
@@ -49659,6 +49678,10 @@ var ts;
49659
49678
  }
49660
49679
  else {
49661
49680
  var tsExtension = ts.tryExtractTSExtension(moduleReference);
49681
+ var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
49682
+ var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
49683
+ var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
49684
+ moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
49662
49685
  if (tsExtension) {
49663
49686
  var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
49664
49687
  var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
@@ -49678,6 +49701,19 @@ var ts;
49678
49701
  ts.hasJsonModuleEmitEnabled(compilerOptions)) {
49679
49702
  error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
49680
49703
  }
49704
+ else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
49705
+ var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
49706
+ var suggestedExt = (_g = suggestedExtensions.find(function (_a) {
49707
+ var actualExt = _a[0], _importExt = _a[1];
49708
+ return host.fileExists(absoluteRef_1 + actualExt);
49709
+ })) === null || _g === void 0 ? void 0 : _g[1];
49710
+ if (suggestedExt) {
49711
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
49712
+ }
49713
+ else {
49714
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
49715
+ }
49716
+ }
49681
49717
  else {
49682
49718
  error(errorNode, moduleNotFoundError, moduleReference);
49683
49719
  }
@@ -61590,7 +61626,8 @@ var ts;
61590
61626
  if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
61591
61627
  if (!type.declaration.nameType) {
61592
61628
  var constraint = void 0;
61593
- if (isArrayType(t) || (t.flags & 1 /* Any */) && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
61629
+ if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 &&
61630
+ (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
61594
61631
  return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
61595
61632
  }
61596
61633
  if (isGenericTupleType(t)) {
@@ -78309,7 +78346,9 @@ var ts;
78309
78346
  var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType);
78310
78347
  if (!typeReferenceNode)
78311
78348
  return undefined;
78312
- var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); // TODO: GH#18217
78349
+ var typeParameters = getTypeParametersForTypeReference(typeReferenceNode);
78350
+ if (!typeParameters)
78351
+ return undefined;
78313
78352
  var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]);
78314
78353
  return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters)));
78315
78354
  }
@@ -94893,11 +94932,11 @@ var ts;
94893
94932
  currentFileState.filenameDeclaration = declaration;
94894
94933
  return currentFileState.filenameDeclaration.name;
94895
94934
  }
94896
- function getJsxFactoryCalleePrimitive(childrenLength) {
94897
- return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx";
94935
+ function getJsxFactoryCalleePrimitive(isStaticChildren) {
94936
+ return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
94898
94937
  }
94899
- function getJsxFactoryCallee(childrenLength) {
94900
- var type = getJsxFactoryCalleePrimitive(childrenLength);
94938
+ function getJsxFactoryCallee(isStaticChildren) {
94939
+ var type = getJsxFactoryCalleePrimitive(isStaticChildren);
94901
94940
  return getImplicitImportForName(type);
94902
94941
  }
94903
94942
  function getImplicitJsxFragmentReference() {
@@ -95049,7 +95088,7 @@ var ts;
95049
95088
  }
95050
95089
  function convertJsxChildrenToChildrenPropAssignment(children) {
95051
95090
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
95052
- if (ts.length(nonWhitespaceChildren) === 1) {
95091
+ if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
95053
95092
  var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
95054
95093
  return result_12 && factory.createPropertyAssignment("children", result_12);
95055
95094
  }
@@ -95063,15 +95102,18 @@ var ts;
95063
95102
  var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
95064
95103
  var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
95065
95104
  factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray); // When there are no attributes, React wants {}
95066
- return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location);
95105
+ return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
95067
95106
  }
95068
- function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) {
95107
+ function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) {
95108
+ var _a;
95109
+ var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
95110
+ var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
95069
95111
  var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
95070
95112
  if (compilerOptions.jsx === 5 /* ReactJSXDev */) {
95071
95113
  var originalFile = ts.getOriginalNode(currentSourceFile);
95072
95114
  if (originalFile && ts.isSourceFile(originalFile)) {
95073
95115
  // isStaticChildren development flag
95074
- args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse());
95116
+ args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
95075
95117
  // __source development flag
95076
95118
  var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
95077
95119
  args.push(factory.createObjectLiteralExpression([
@@ -95083,7 +95125,7 @@ var ts;
95083
95125
  args.push(factory.createThis());
95084
95126
  }
95085
95127
  }
95086
- var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location);
95128
+ var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), /*typeArguments*/ undefined, args), location);
95087
95129
  if (isChild) {
95088
95130
  ts.startOnNewLine(element);
95089
95131
  }
@@ -95113,7 +95155,7 @@ var ts;
95113
95155
  }
95114
95156
  }
95115
95157
  return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]),
95116
- /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location);
95158
+ /*keyAttr*/ undefined, children, isChild, location);
95117
95159
  }
95118
95160
  function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
95119
95161
  var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
@@ -114189,8 +114231,8 @@ var ts;
114189
114231
  var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
114190
114232
  var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
114191
114233
  // ensure that types resolutions are still correct
114192
- var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
114193
- if (typeReferenceEesolutionsChanged) {
114234
+ var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
114235
+ if (typeReferenceResolutionsChanged) {
114194
114236
  structureIsReused = 1 /* SafeModules */;
114195
114237
  newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
114196
114238
  }
@@ -115478,6 +115520,21 @@ var ts;
115478
115520
  return resolvedRef;
115479
115521
  }
115480
115522
  function verifyCompilerOptions() {
115523
+ var isNightly = ts.stringContains(ts.version, "-dev");
115524
+ if (!isNightly) {
115525
+ if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
115526
+ createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "node12");
115527
+ }
115528
+ else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
115529
+ createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "nodenext");
115530
+ }
115531
+ else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
115532
+ createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "node12");
115533
+ }
115534
+ else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
115535
+ createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "nodenext");
115536
+ }
115537
+ }
115481
115538
  if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
115482
115539
  createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
115483
115540
  }
@@ -115956,8 +116013,8 @@ var ts;
115956
116013
  function createDiagnosticForOptionName(message, option1, option2, option3) {
115957
116014
  createDiagnosticForOption(/*onKey*/ true, option1, option2, message, option1, option2, option3);
115958
116015
  }
115959
- function createOptionValueDiagnostic(option1, message, arg0) {
115960
- createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0);
116016
+ function createOptionValueDiagnostic(option1, message, arg0, arg1) {
116017
+ createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0, arg1);
115961
116018
  }
115962
116019
  function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
115963
116020
  var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
@@ -118201,6 +118258,9 @@ var ts;
118201
118258
  else {
118202
118259
  resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
118203
118260
  perDirectoryResolution.set(name, mode, resolution);
118261
+ if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
118262
+ resolutionHost.onDiscoveredSymlink();
118263
+ }
118204
118264
  }
118205
118265
  resolutionsInFile.set(name, mode, resolution);
118206
118266
  watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
@@ -118669,6 +118729,11 @@ var ts;
118669
118729
  }
118670
118730
  }
118671
118731
  ts.createResolutionCache = createResolutionCache;
118732
+ function resolutionIsSymlink(resolution) {
118733
+ var _a, _b;
118734
+ return !!(((_a = resolution.resolvedModule) === null || _a === void 0 ? void 0 : _a.originalPath) ||
118735
+ ((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath));
118736
+ }
118672
118737
  })(ts || (ts = {}));
118673
118738
  // Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.
118674
118739
  /* @internal */
@@ -839,6 +839,7 @@
839
839
  "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc \"@typedef\" 标记应具有类型注释,或其后跟有 \"@property\" 或 \"@member\" 标记。",
840
840
  "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 类型只能在文档注释内部使用。",
841
841
  "JSDoc_types_may_be_moved_to_TypeScript_types_80004": "JSDoc 类型可能会移到 TypeScript 类型。",
842
+ "JSON_imports_are_experimental_in_ES_module_mode_imports_7062": "JSON 导入在 ES 模块模式导入中是实验性的。",
842
843
  "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "只能为 JSX 属性分配非空“表达式”。",
843
844
  "JSX_element_0_has_no_corresponding_closing_tag_17008": "JSX 元素“{0}”没有相应的结束标记。",
844
845
  "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607": "JSX 元素类不支持特性,因为它不具有“{0}”属性。",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.5.0-dev.20211029",
5
+ "version": "4.6.0-dev.20211102",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [