typescript 5.0.0-dev.20230202 → 5.0.0-dev.20230203

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/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.0";
38
- version = `${versionMajorMinor}.0-dev.20230202`;
38
+ version = `${versionMajorMinor}.0-dev.20230203`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -38241,6 +38241,22 @@ ${lanes.join("\n")}
38241
38241
  Debug.assert(extensionIsTS(resolved.extension));
38242
38242
  return { fileName: resolved.path, packageId: resolved.packageId };
38243
38243
  }
38244
+ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) {
38245
+ if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
38246
+ const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
38247
+ if (originalPath)
38248
+ resolved = { ...resolved, path: resolvedFileName, originalPath };
38249
+ }
38250
+ return createResolvedModuleWithFailedLookupLocations(
38251
+ resolved,
38252
+ isExternalLibraryImport,
38253
+ failedLookupLocations,
38254
+ affectingLocations,
38255
+ diagnostics,
38256
+ state.resultFromCache,
38257
+ legacyResult
38258
+ );
38259
+ }
38244
38260
  function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
38245
38261
  if (resultFromCache) {
38246
38262
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
@@ -38399,6 +38415,15 @@ ${lanes.join("\n")}
38399
38415
  const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
38400
38416
  return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
38401
38417
  }
38418
+ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
38419
+ const resolvedFileName = realPath(fileName, host, traceEnabled);
38420
+ const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
38421
+ return {
38422
+ // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
38423
+ resolvedFileName: pathsAreEqual ? fileName : resolvedFileName,
38424
+ originalPath: pathsAreEqual ? void 0 : fileName
38425
+ };
38426
+ }
38402
38427
  function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
38403
38428
  Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
38404
38429
  const traceEnabled = isTraceEnabled(options, host);
@@ -38470,13 +38495,13 @@ ${lanes.join("\n")}
38470
38495
  let resolvedTypeReferenceDirective;
38471
38496
  if (resolved) {
38472
38497
  const { fileName, packageId } = resolved;
38473
- const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);
38474
- const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
38498
+ let resolvedFileName = fileName, originalPath;
38499
+ if (!options.preserveSymlinks)
38500
+ ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled));
38475
38501
  resolvedTypeReferenceDirective = {
38476
38502
  primary,
38477
- // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
38478
- resolvedFileName: pathsAreEqual ? fileName : resolvedFileName,
38479
- originalPath: pathsAreEqual ? void 0 : fileName,
38503
+ resolvedFileName,
38504
+ originalPath,
38480
38505
  packageId,
38481
38506
  isExternalLibraryImport: pathContainsNodeModules(fileName)
38482
38507
  };
@@ -39346,13 +39371,14 @@ ${lanes.join("\n")}
39346
39371
  legacyResult = diagnosticResult.value.resolved.path;
39347
39372
  }
39348
39373
  }
39349
- return createResolvedModuleWithFailedLookupLocations(
39374
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
39375
+ moduleName,
39350
39376
  (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
39351
39377
  (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
39352
39378
  failedLookupLocations,
39353
39379
  affectingLocations,
39354
39380
  diagnostics,
39355
- state.resultFromCache,
39381
+ state,
39356
39382
  legacyResult
39357
39383
  );
39358
39384
  function tryResolve(extensions2, state2) {
@@ -39382,16 +39408,7 @@ ${lanes.join("\n")}
39382
39408
  }
39383
39409
  resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
39384
39410
  }
39385
- if (!resolved2)
39386
- return void 0;
39387
- let resolvedValue = resolved2.value;
39388
- if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {
39389
- const path = realPath(resolvedValue.path, host, traceEnabled);
39390
- const pathsAreEqual = arePathsEqual(path, resolvedValue.path, host);
39391
- const originalPath = pathsAreEqual ? void 0 : resolvedValue.path;
39392
- resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path, originalPath };
39393
- }
39394
- return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
39411
+ return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } };
39395
39412
  } else {
39396
39413
  const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName);
39397
39414
  const resolved2 = nodeLoadModuleByRelativeName(
@@ -40545,13 +40562,14 @@ ${lanes.join("\n")}
40545
40562
  candidateIsFromPackageJsonField: false
40546
40563
  };
40547
40564
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
40548
- return createResolvedModuleWithFailedLookupLocations(
40565
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
40566
+ moduleName,
40549
40567
  resolved && resolved.value,
40550
40568
  (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
40551
40569
  failedLookupLocations,
40552
40570
  affectingLocations,
40553
40571
  diagnostics,
40554
- state.resultFromCache
40572
+ state
40555
40573
  );
40556
40574
  function tryResolve(extensions) {
40557
40575
  const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
@@ -46678,7 +46696,12 @@ ${lanes.join("\n")}
46678
46696
  }
46679
46697
  function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) {
46680
46698
  const exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */);
46681
- const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name);
46699
+ const exportSymbol = exportValue ? getPropertyOfType(
46700
+ getTypeOfSymbol(exportValue),
46701
+ name,
46702
+ /*skipObjectFunctionPropertyAugment*/
46703
+ true
46704
+ ) : moduleSymbol.exports.get(name);
46682
46705
  const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
46683
46706
  markSymbolOfAliasDeclarationIfTypeOnly(
46684
46707
  sourceNode,
@@ -56093,7 +56116,7 @@ ${lanes.join("\n")}
56093
56116
  for (const tag of node.tags) {
56094
56117
  if (isJSDocOverloadTag(tag)) {
56095
56118
  const jsDocSignature = tag.typeExpression;
56096
- if (jsDocSignature.type === void 0) {
56119
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
56097
56120
  reportImplicitAny(jsDocSignature, anyType);
56098
56121
  }
56099
56122
  result.push(getSignatureFromDeclaration(jsDocSignature));
@@ -56205,6 +56228,12 @@ ${lanes.join("\n")}
56205
56228
  if (declaration.kind === 173 /* Constructor */) {
56206
56229
  return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
56207
56230
  }
56231
+ if (isJSDocSignature(declaration)) {
56232
+ const root = getJSDocRoot(declaration);
56233
+ if (root && isConstructorDeclaration(root.parent)) {
56234
+ return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol));
56235
+ }
56236
+ }
56208
56237
  if (isJSDocConstructSignature(declaration)) {
56209
56238
  return getTypeFromTypeNode(declaration.parameters[0].type);
56210
56239
  }
@@ -60925,7 +60954,6 @@ ${lanes.join("\n")}
60925
60954
  let overrideNextErrorInfo = 0;
60926
60955
  let lastSkippedInfo;
60927
60956
  let incompatibleStack;
60928
- let inPropertyCheck = false;
60929
60957
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
60930
60958
  const result = isRelatedTo(
60931
60959
  source,
@@ -61884,14 +61912,15 @@ ${lanes.join("\n")}
61884
61912
  );
61885
61913
  }
61886
61914
  }
61887
- if (result2 && !inPropertyCheck && (target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */)))) {
61888
- inPropertyCheck = true;
61915
+ if (result2 && !(intersectionState & 2 /* Target */) && target2.flags & 2097152 /* Intersection */ && !isGenericObjectType(target2) && source2.flags & (524288 /* Object */ | 2097152 /* Intersection */)) {
61889
61916
  result2 &= propertiesRelatedTo(
61890
61917
  source2,
61891
61918
  target2,
61892
61919
  reportErrors2,
61893
61920
  /*excludedProperties*/
61894
61921
  void 0,
61922
+ /*optionalsOnly*/
61923
+ false,
61895
61924
  0 /* None */
61896
61925
  );
61897
61926
  if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) {
@@ -61904,7 +61933,17 @@ ${lanes.join("\n")}
61904
61933
  0 /* None */
61905
61934
  );
61906
61935
  }
61907
- inPropertyCheck = false;
61936
+ } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
61937
+ result2 &= propertiesRelatedTo(
61938
+ source2,
61939
+ target2,
61940
+ reportErrors2,
61941
+ /*excludedProperties*/
61942
+ void 0,
61943
+ /*optionalsOnly*/
61944
+ true,
61945
+ intersectionState
61946
+ );
61908
61947
  }
61909
61948
  }
61910
61949
  if (result2) {
@@ -62394,12 +62433,14 @@ ${lanes.join("\n")}
62394
62433
  reportStructuralErrors,
62395
62434
  /*excludedProperties*/
62396
62435
  void 0,
62436
+ /*optionalsOnly*/
62437
+ false,
62397
62438
  intersectionState
62398
62439
  );
62399
62440
  if (result2) {
62400
- result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors);
62441
+ result2 &= signaturesRelatedTo(source2, target2, 0 /* Call */, reportStructuralErrors, intersectionState);
62401
62442
  if (result2) {
62402
- result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors);
62443
+ result2 &= signaturesRelatedTo(source2, target2, 1 /* Construct */, reportStructuralErrors, intersectionState);
62403
62444
  if (result2) {
62404
62445
  result2 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState);
62405
62446
  }
@@ -62528,6 +62569,8 @@ ${lanes.join("\n")}
62528
62569
  /*reportErrors*/
62529
62570
  false,
62530
62571
  excludedProperties,
62572
+ /*optionalsOnly*/
62573
+ false,
62531
62574
  0 /* None */
62532
62575
  );
62533
62576
  if (result2) {
@@ -62536,7 +62579,8 @@ ${lanes.join("\n")}
62536
62579
  type,
62537
62580
  0 /* Call */,
62538
62581
  /*reportStructuralErrors*/
62539
- false
62582
+ false,
62583
+ 0 /* None */
62540
62584
  );
62541
62585
  if (result2) {
62542
62586
  result2 &= signaturesRelatedTo(
@@ -62544,7 +62588,8 @@ ${lanes.join("\n")}
62544
62588
  type,
62545
62589
  1 /* Construct */,
62546
62590
  /*reportStructuralErrors*/
62547
- false
62591
+ false,
62592
+ 0 /* None */
62548
62593
  );
62549
62594
  if (result2 && !(isTupleType(source2) && isTupleType(type))) {
62550
62595
  result2 &= indexSignaturesRelatedTo(
@@ -62722,7 +62767,7 @@ ${lanes.join("\n")}
62722
62767
  }
62723
62768
  }
62724
62769
  }
62725
- function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, intersectionState) {
62770
+ function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) {
62726
62771
  if (relation === identityRelation) {
62727
62772
  return propertiesIdenticalTo(source2, target2, excludedProperties);
62728
62773
  }
@@ -62858,7 +62903,7 @@ ${lanes.join("\n")}
62858
62903
  const numericNamesOnly = isTupleType(source2) && isTupleType(target2);
62859
62904
  for (const targetProp of excludeProperties(properties, excludedProperties)) {
62860
62905
  const name = targetProp.escapedName;
62861
- if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
62906
+ if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length") && (!optionalsOnly || targetProp.flags & 16777216 /* Optional */)) {
62862
62907
  const sourceProp = getPropertyOfType(source2, name);
62863
62908
  if (sourceProp && sourceProp !== targetProp) {
62864
62909
  const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation);
@@ -62894,7 +62939,7 @@ ${lanes.join("\n")}
62894
62939
  }
62895
62940
  return result2;
62896
62941
  }
62897
- function signaturesRelatedTo(source2, target2, kind, reportErrors2) {
62942
+ function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
62898
62943
  var _a3, _b;
62899
62944
  if (relation === identityRelation) {
62900
62945
  return signaturesIdenticalTo(source2, target2, kind);
@@ -62931,6 +62976,7 @@ ${lanes.join("\n")}
62931
62976
  /*erase*/
62932
62977
  true,
62933
62978
  reportErrors2,
62979
+ intersectionState,
62934
62980
  incompatibleReporter(sourceSignatures[i], targetSignatures[i])
62935
62981
  );
62936
62982
  if (!related) {
@@ -62942,7 +62988,7 @@ ${lanes.join("\n")}
62942
62988
  const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks;
62943
62989
  const sourceSignature = first(sourceSignatures);
62944
62990
  const targetSignature = first(targetSignatures);
62945
- result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, incompatibleReporter(sourceSignature, targetSignature));
62991
+ result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature));
62946
62992
  if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 173 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 173 /* Constructor */)) {
62947
62993
  const constructSignatureToString = (signature) => signatureToString(
62948
62994
  signature,
@@ -62967,6 +63013,7 @@ ${lanes.join("\n")}
62967
63013
  /*erase*/
62968
63014
  true,
62969
63015
  shouldElaborateErrors,
63016
+ intersectionState,
62970
63017
  incompatibleReporter(s, t)
62971
63018
  );
62972
63019
  if (related) {
@@ -63019,7 +63066,7 @@ ${lanes.join("\n")}
63019
63066
  }
63020
63067
  return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
63021
63068
  }
63022
- function signatureRelatedTo(source2, target2, erase, reportErrors2, incompatibleReporter) {
63069
+ function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
63023
63070
  return compareSignaturesRelated(
63024
63071
  erase ? getErasedSignature(source2) : source2,
63025
63072
  erase ? getErasedSignature(target2) : target2,
@@ -63027,9 +63074,20 @@ ${lanes.join("\n")}
63027
63074
  reportErrors2,
63028
63075
  reportError,
63029
63076
  incompatibleReporter,
63030
- isRelatedToWorker,
63077
+ isRelatedToWorker2,
63031
63078
  reportUnreliableMapper
63032
63079
  );
63080
+ function isRelatedToWorker2(source3, target3, reportErrors3) {
63081
+ return isRelatedTo(
63082
+ source3,
63083
+ target3,
63084
+ 3 /* Both */,
63085
+ reportErrors3,
63086
+ /*headMessage*/
63087
+ void 0,
63088
+ intersectionState
63089
+ );
63090
+ }
63033
63091
  }
63034
63092
  function signaturesIdenticalTo(source2, target2, kind) {
63035
63093
  const sourceSignatures = getSignaturesOfType(source2, kind);
@@ -63088,7 +63146,7 @@ ${lanes.join("\n")}
63088
63146
  }
63089
63147
  for (const info of getIndexInfosOfType(source2)) {
63090
63148
  if (isApplicableIndexType(info.keyType, keyType)) {
63091
- const related = indexInfoRelatedTo(info, targetInfo, reportErrors2);
63149
+ const related = indexInfoRelatedTo(info, targetInfo, reportErrors2, intersectionState);
63092
63150
  if (!related) {
63093
63151
  return 0 /* False */;
63094
63152
  }
@@ -63097,8 +63155,16 @@ ${lanes.join("\n")}
63097
63155
  }
63098
63156
  return result2;
63099
63157
  }
63100
- function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2) {
63101
- const related = isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */, reportErrors2);
63158
+ function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) {
63159
+ const related = isRelatedTo(
63160
+ sourceInfo.type,
63161
+ targetInfo.type,
63162
+ 3 /* Both */,
63163
+ reportErrors2,
63164
+ /*headMessage*/
63165
+ void 0,
63166
+ intersectionState
63167
+ );
63102
63168
  if (!related && reportErrors2) {
63103
63169
  if (sourceInfo.keyType === targetInfo.keyType) {
63104
63170
  reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
@@ -63127,7 +63193,7 @@ ${lanes.join("\n")}
63127
63193
  function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) {
63128
63194
  const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType);
63129
63195
  if (sourceInfo) {
63130
- return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2);
63196
+ return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
63131
63197
  }
63132
63198
  if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
63133
63199
  return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
@@ -63418,12 +63484,15 @@ ${lanes.join("\n")}
63418
63484
  }
63419
63485
  function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
63420
63486
  if (depth >= maxDepth) {
63487
+ if (type.flags & 2097152 /* Intersection */) {
63488
+ return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
63489
+ }
63421
63490
  const identity2 = getRecursionIdentity(type);
63422
63491
  let count = 0;
63423
63492
  let lastTypeId = 0;
63424
63493
  for (let i = 0; i < depth; i++) {
63425
63494
  const t = stack[i];
63426
- if (getRecursionIdentity(t) === identity2) {
63495
+ if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) {
63427
63496
  if (t.id >= lastTypeId) {
63428
63497
  count++;
63429
63498
  if (count >= maxDepth) {
@@ -72442,7 +72511,7 @@ ${lanes.join("\n")}
72442
72511
  }
72443
72512
  }
72444
72513
  function checkCallExpression(node, checkMode) {
72445
- var _a2;
72514
+ var _a2, _b, _c;
72446
72515
  checkGrammarTypeArguments(node, node.typeArguments);
72447
72516
  const signature = getResolvedSignature(
72448
72517
  node,
@@ -72459,7 +72528,7 @@ ${lanes.join("\n")}
72459
72528
  }
72460
72529
  if (node.kind === 211 /* NewExpression */) {
72461
72530
  const declaration = signature.declaration;
72462
- if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
72531
+ if (declaration && declaration.kind !== 173 /* Constructor */ && declaration.kind !== 177 /* ConstructSignature */ && declaration.kind !== 182 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 173 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
72463
72532
  if (noImplicitAny) {
72464
72533
  error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
72465
72534
  }
@@ -72487,7 +72556,7 @@ ${lanes.join("\n")}
72487
72556
  /*allowDeclaration*/
72488
72557
  false
72489
72558
  );
72490
- if ((_a2 = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _a2.size) {
72559
+ if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
72491
72560
  const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
72492
72561
  jsAssignmentType.objectFlags |= 4096 /* JSLiteral */;
72493
72562
  return getIntersectionType([returnType, jsAssignmentType]);
@@ -84390,8 +84459,8 @@ ${lanes.join("\n")}
84390
84459
  "use strict";
84391
84460
  init_ts2();
84392
84461
  init_ts2();
84393
- init_ts_performance();
84394
84462
  init_ts_moduleSpecifiers();
84463
+ init_ts_performance();
84395
84464
  ambientModuleSymbolRegex = /^".+"$/;
84396
84465
  anon = "(anonymous)";
84397
84466
  nextSymbolId = 1;
@@ -133413,9 +133482,9 @@ ${lanes.join("\n")}
133413
133482
  "src/services/services.ts"() {
133414
133483
  "use strict";
133415
133484
  init_ts4();
133485
+ init_ts4();
133416
133486
  init_ts_NavigateTo();
133417
133487
  init_ts_NavigationBar();
133418
- init_ts4();
133419
133488
  servicesVersion = "0.8";
133420
133489
  NodeObject = class {
133421
133490
  constructor(kind, pos, end) {
@@ -136421,8 +136490,8 @@ ${lanes.join("\n")}
136421
136490
  var init_addEmptyExportDeclaration = __esm({
136422
136491
  "src/services/codefixes/addEmptyExportDeclaration.ts"() {
136423
136492
  "use strict";
136424
- init_ts_codefix();
136425
136493
  init_ts4();
136494
+ init_ts_codefix();
136426
136495
  registerCodeFix({
136427
136496
  errorCodes: [
136428
136497
  Diagnostics.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.code,
@@ -138786,8 +138855,8 @@ ${lanes.join("\n")}
138786
138855
  var init_convertToEsModule = __esm({
138787
138856
  "src/services/codefixes/convertToEsModule.ts"() {
138788
138857
  "use strict";
138789
- init_ts_codefix();
138790
138858
  init_ts4();
138859
+ init_ts_codefix();
138791
138860
  registerCodeFix({
138792
138861
  errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],
138793
138862
  getCodeActions(context) {
@@ -142386,8 +142455,8 @@ ${lanes.join("\n")}
142386
142455
  var init_fixModuleAndTargetOptions = __esm({
142387
142456
  "src/services/codefixes/fixModuleAndTargetOptions.ts"() {
142388
142457
  "use strict";
142389
- init_ts_codefix();
142390
142458
  init_ts4();
142459
+ init_ts_codefix();
142391
142460
  registerCodeFix({
142392
142461
  errorCodes: [
142393
142462
  Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
@@ -147719,7 +147788,7 @@ ${lanes.join("\n")}
147719
147788
  }
147720
147789
  function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
147721
147790
  const replacementSpan = importStatementCompletion.replacementSpan;
147722
- const quotedModuleSpecifier = quote(sourceFile, preferences, origin.moduleSpecifier);
147791
+ const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier));
147723
147792
  const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */;
147724
147793
  const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
147725
147794
  const importKind = ts_codefix_exports.getImportKind(
@@ -157719,6 +157788,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157719
157788
  if (isExpression(body)) {
157720
157789
  const returnStatement = factory.createReturnStatement(body);
157721
157790
  const file = body.getSourceFile();
157791
+ setTextRange(returnStatement, body);
157722
157792
  suppressLeadingAndTrailingTrivia(returnStatement);
157723
157793
  copyTrailingAsLeadingComments(
157724
157794
  body,
@@ -164697,8 +164767,8 @@ ${options.prefix}` : "\n" : options.prefix
164697
164767
  var init_rules = __esm({
164698
164768
  "src/services/formatting/rules.ts"() {
164699
164769
  "use strict";
164700
- init_ts_formatting();
164701
164770
  init_ts4();
164771
+ init_ts_formatting();
164702
164772
  }
164703
164773
  });
164704
164774
 
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.0";
57
- var version = `${versionMajorMinor}.0-dev.20230202`;
57
+ var version = `${versionMajorMinor}.0-dev.20230203`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -27922,6 +27922,22 @@ function formatExtensions(extensions) {
27922
27922
  result.push("JSON");
27923
27923
  return result.join(", ");
27924
27924
  }
27925
+ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) {
27926
+ if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
27927
+ const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
27928
+ if (originalPath)
27929
+ resolved = { ...resolved, path: resolvedFileName, originalPath };
27930
+ }
27931
+ return createResolvedModuleWithFailedLookupLocations(
27932
+ resolved,
27933
+ isExternalLibraryImport,
27934
+ failedLookupLocations,
27935
+ affectingLocations,
27936
+ diagnostics,
27937
+ state.resultFromCache,
27938
+ legacyResult
27939
+ );
27940
+ }
27925
27941
  function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
27926
27942
  if (resultFromCache) {
27927
27943
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
@@ -28054,6 +28070,15 @@ function arePathsEqual(path1, path2, host) {
28054
28070
  const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
28055
28071
  return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
28056
28072
  }
28073
+ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
28074
+ const resolvedFileName = realPath(fileName, host, traceEnabled);
28075
+ const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
28076
+ return {
28077
+ // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
28078
+ resolvedFileName: pathsAreEqual ? fileName : resolvedFileName,
28079
+ originalPath: pathsAreEqual ? void 0 : fileName
28080
+ };
28081
+ }
28057
28082
  function getNodeResolutionFeatures(options) {
28058
28083
  let features = NodeResolutionFeatures.None;
28059
28084
  switch (getEmitModuleResolutionKind(options)) {
@@ -28439,13 +28464,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
28439
28464
  legacyResult = diagnosticResult.value.resolved.path;
28440
28465
  }
28441
28466
  }
28442
- return createResolvedModuleWithFailedLookupLocations(
28467
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
28468
+ moduleName,
28443
28469
  (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
28444
28470
  (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
28445
28471
  failedLookupLocations,
28446
28472
  affectingLocations,
28447
28473
  diagnostics,
28448
- state.resultFromCache,
28474
+ state,
28449
28475
  legacyResult
28450
28476
  );
28451
28477
  function tryResolve(extensions2, state2) {
@@ -28475,16 +28501,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
28475
28501
  }
28476
28502
  resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
28477
28503
  }
28478
- if (!resolved2)
28479
- return void 0;
28480
- let resolvedValue = resolved2.value;
28481
- if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {
28482
- const path2 = realPath(resolvedValue.path, host, traceEnabled);
28483
- const pathsAreEqual = arePathsEqual(path2, resolvedValue.path, host);
28484
- const originalPath = pathsAreEqual ? void 0 : resolvedValue.path;
28485
- resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path2, originalPath };
28486
- }
28487
- return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
28504
+ return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } };
28488
28505
  } else {
28489
28506
  const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName);
28490
28507
  const resolved2 = nodeLoadModuleByRelativeName(
@@ -29510,13 +29527,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
29510
29527
  candidateIsFromPackageJsonField: false
29511
29528
  };
29512
29529
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
29513
- return createResolvedModuleWithFailedLookupLocations(
29530
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
29531
+ moduleName,
29514
29532
  resolved && resolved.value,
29515
29533
  (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
29516
29534
  failedLookupLocations,
29517
29535
  affectingLocations,
29518
29536
  diagnostics,
29519
- state.resultFromCache
29537
+ state
29520
29538
  );
29521
29539
  function tryResolve(extensions) {
29522
29540
  const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
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": "5.0.0-dev.20230202",
5
+ "version": "5.0.0-dev.20230203",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -66,6 +66,7 @@
66
66
  "eslint-plugin-import": "^2.26.0",
67
67
  "eslint-plugin-local": "^1.0.0",
68
68
  "eslint-plugin-no-null": "^1.0.2",
69
+ "eslint-plugin-simple-import-sort": "^10.0.0",
69
70
  "fast-xml-parser": "^4.0.11",
70
71
  "fs-extra": "^9.1.0",
71
72
  "glob": "latest",