typescript 5.0.0-dev.20230202 → 5.0.0-dev.20230204

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.
@@ -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.20230204`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5980,7 +5980,6 @@ var Diagnostics = {
5980
5980
  Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."),
5981
5981
  Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"),
5982
5982
  _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),
5983
- An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),
5984
5983
  _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),
5985
5984
  _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."),
5986
5985
  Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."),
@@ -27922,6 +27921,22 @@ function formatExtensions(extensions) {
27922
27921
  result.push("JSON");
27923
27922
  return result.join(", ");
27924
27923
  }
27924
+ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) {
27925
+ if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
27926
+ const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
27927
+ if (originalPath)
27928
+ resolved = { ...resolved, path: resolvedFileName, originalPath };
27929
+ }
27930
+ return createResolvedModuleWithFailedLookupLocations(
27931
+ resolved,
27932
+ isExternalLibraryImport,
27933
+ failedLookupLocations,
27934
+ affectingLocations,
27935
+ diagnostics,
27936
+ state.resultFromCache,
27937
+ legacyResult
27938
+ );
27939
+ }
27925
27940
  function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
27926
27941
  if (resultFromCache) {
27927
27942
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
@@ -28054,6 +28069,15 @@ function arePathsEqual(path1, path2, host) {
28054
28069
  const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
28055
28070
  return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
28056
28071
  }
28072
+ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
28073
+ const resolvedFileName = realPath(fileName, host, traceEnabled);
28074
+ const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host);
28075
+ return {
28076
+ // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
28077
+ resolvedFileName: pathsAreEqual ? fileName : resolvedFileName,
28078
+ originalPath: pathsAreEqual ? void 0 : fileName
28079
+ };
28080
+ }
28057
28081
  function getNodeResolutionFeatures(options) {
28058
28082
  let features = NodeResolutionFeatures.None;
28059
28083
  switch (getEmitModuleResolutionKind(options)) {
@@ -28439,13 +28463,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
28439
28463
  legacyResult = diagnosticResult.value.resolved.path;
28440
28464
  }
28441
28465
  }
28442
- return createResolvedModuleWithFailedLookupLocations(
28466
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
28467
+ moduleName,
28443
28468
  (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
28444
28469
  (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
28445
28470
  failedLookupLocations,
28446
28471
  affectingLocations,
28447
28472
  diagnostics,
28448
- state.resultFromCache,
28473
+ state,
28449
28474
  legacyResult
28450
28475
  );
28451
28476
  function tryResolve(extensions2, state2) {
@@ -28475,16 +28500,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
28475
28500
  }
28476
28501
  resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
28477
28502
  }
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 } };
28503
+ return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } };
28488
28504
  } else {
28489
28505
  const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName);
28490
28506
  const resolved2 = nodeLoadModuleByRelativeName(
@@ -29510,13 +29526,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
29510
29526
  candidateIsFromPackageJsonField: false
29511
29527
  };
29512
29528
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
29513
- return createResolvedModuleWithFailedLookupLocations(
29529
+ return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
29530
+ moduleName,
29514
29531
  resolved && resolved.value,
29515
29532
  (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
29516
29533
  failedLookupLocations,
29517
29534
  affectingLocations,
29518
29535
  diagnostics,
29519
- state.resultFromCache
29536
+ state
29520
29537
  );
29521
29538
  function tryResolve(extensions) {
29522
29539
  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.20230204",
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",