typescript 5.0.0-dev.20230201 → 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/lib.d.ts +0 -2
- package/lib/lib.decorators.d.ts +0 -2
- package/lib/lib.decorators.legacy.d.ts +0 -2
- package/lib/lib.dom.d.ts +0 -2
- package/lib/lib.dom.iterable.d.ts +0 -2
- package/lib/lib.es2015.collection.d.ts +0 -2
- package/lib/lib.es2015.core.d.ts +0 -2
- package/lib/lib.es2015.d.ts +0 -2
- package/lib/lib.es2015.generator.d.ts +0 -2
- package/lib/lib.es2015.iterable.d.ts +0 -2
- package/lib/lib.es2015.promise.d.ts +0 -2
- package/lib/lib.es2015.proxy.d.ts +0 -2
- package/lib/lib.es2015.reflect.d.ts +0 -2
- package/lib/lib.es2015.symbol.d.ts +0 -2
- package/lib/lib.es2015.symbol.wellknown.d.ts +0 -2
- package/lib/lib.es2016.array.include.d.ts +0 -2
- package/lib/lib.es2016.d.ts +0 -2
- package/lib/lib.es2016.full.d.ts +0 -2
- package/lib/lib.es2017.d.ts +0 -2
- package/lib/lib.es2017.full.d.ts +0 -2
- package/lib/lib.es2017.intl.d.ts +0 -2
- package/lib/lib.es2017.object.d.ts +0 -2
- package/lib/lib.es2017.sharedmemory.d.ts +0 -2
- package/lib/lib.es2017.string.d.ts +0 -2
- package/lib/lib.es2017.typedarrays.d.ts +0 -2
- package/lib/lib.es2018.asyncgenerator.d.ts +0 -2
- package/lib/lib.es2018.asynciterable.d.ts +0 -2
- package/lib/lib.es2018.d.ts +0 -2
- package/lib/lib.es2018.full.d.ts +0 -2
- package/lib/lib.es2018.intl.d.ts +0 -2
- package/lib/lib.es2018.promise.d.ts +0 -2
- package/lib/lib.es2018.regexp.d.ts +0 -2
- package/lib/lib.es2019.array.d.ts +0 -2
- package/lib/lib.es2019.d.ts +0 -2
- package/lib/lib.es2019.full.d.ts +0 -2
- package/lib/lib.es2019.intl.d.ts +0 -2
- package/lib/lib.es2019.object.d.ts +0 -2
- package/lib/lib.es2019.string.d.ts +0 -2
- package/lib/lib.es2019.symbol.d.ts +0 -2
- package/lib/lib.es2020.bigint.d.ts +0 -2
- package/lib/lib.es2020.d.ts +0 -2
- package/lib/lib.es2020.date.d.ts +0 -2
- package/lib/lib.es2020.full.d.ts +0 -2
- package/lib/lib.es2020.intl.d.ts +0 -2
- package/lib/lib.es2020.number.d.ts +0 -2
- package/lib/lib.es2020.promise.d.ts +0 -2
- package/lib/lib.es2020.sharedmemory.d.ts +0 -2
- package/lib/lib.es2020.string.d.ts +0 -2
- package/lib/lib.es2020.symbol.wellknown.d.ts +0 -2
- package/lib/lib.es2021.d.ts +0 -2
- package/lib/lib.es2021.full.d.ts +0 -2
- package/lib/lib.es2021.intl.d.ts +0 -2
- package/lib/lib.es2021.promise.d.ts +0 -2
- package/lib/lib.es2021.string.d.ts +0 -2
- package/lib/lib.es2021.weakref.d.ts +0 -2
- package/lib/lib.es2022.array.d.ts +0 -2
- package/lib/lib.es2022.d.ts +0 -2
- package/lib/lib.es2022.error.d.ts +0 -2
- package/lib/lib.es2022.full.d.ts +0 -2
- package/lib/lib.es2022.intl.d.ts +0 -2
- package/lib/lib.es2022.object.d.ts +0 -2
- package/lib/lib.es2022.regexp.d.ts +0 -2
- package/lib/lib.es2022.sharedmemory.d.ts +0 -2
- package/lib/lib.es2022.string.d.ts +0 -2
- package/lib/lib.es2023.array.d.ts +0 -2
- package/lib/lib.es2023.d.ts +0 -2
- package/lib/lib.es2023.full.d.ts +0 -2
- package/lib/lib.es5.d.ts +0 -2
- package/lib/lib.es6.d.ts +0 -2
- package/lib/lib.esnext.d.ts +0 -2
- package/lib/lib.esnext.full.d.ts +0 -2
- package/lib/lib.esnext.intl.d.ts +0 -2
- package/lib/lib.scripthost.d.ts +0 -2
- package/lib/lib.webworker.d.ts +0 -2
- package/lib/lib.webworker.importscripts.d.ts +0 -2
- package/lib/lib.webworker.iterable.d.ts +0 -2
- package/lib/tsc.js +132 -60
- package/lib/tsserver.js +2884 -2805
- package/lib/tsserverlibrary.d.ts +16 -0
- package/lib/tsserverlibrary.js +154 -75
- package/lib/typescript.d.ts +16 -0
- package/lib/typescript.js +151 -72
- package/lib/typingsInstaller.js +35 -18
- package/package.json +2 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -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.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230203`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -5459,7 +5459,6 @@ var Diagnostics = {
|
|
|
5459
5459
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
5460
5460
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
5461
5461
|
Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
|
|
5462
|
-
Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
5463
5462
|
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
|
|
5464
5463
|
A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
5465
5464
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
@@ -6105,7 +6104,7 @@ var Diagnostics = {
|
|
|
6105
6104
|
Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
|
|
6106
6105
|
This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
|
|
6107
6106
|
A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
|
|
6108
|
-
|
|
6107
|
+
Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),
|
|
6109
6108
|
Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
|
|
6110
6109
|
Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
|
|
6111
6110
|
Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
|
|
@@ -22866,7 +22865,7 @@ var Parser;
|
|
|
22866
22865
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
22867
22866
|
const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc);
|
|
22868
22867
|
if (token() === 63 /* EqualsToken */) {
|
|
22869
|
-
parseErrorAtCurrentToken(Diagnostics.
|
|
22868
|
+
parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
|
|
22870
22869
|
nextToken();
|
|
22871
22870
|
}
|
|
22872
22871
|
return result;
|
|
@@ -27923,6 +27922,22 @@ function formatExtensions(extensions) {
|
|
|
27923
27922
|
result.push("JSON");
|
|
27924
27923
|
return result.join(", ");
|
|
27925
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
|
+
}
|
|
27926
27941
|
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
|
|
27927
27942
|
if (resultFromCache) {
|
|
27928
27943
|
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
@@ -28055,6 +28070,15 @@ function arePathsEqual(path1, path2, host) {
|
|
|
28055
28070
|
const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
28056
28071
|
return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
|
|
28057
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
|
+
}
|
|
28058
28082
|
function getNodeResolutionFeatures(options) {
|
|
28059
28083
|
let features = NodeResolutionFeatures.None;
|
|
28060
28084
|
switch (getEmitModuleResolutionKind(options)) {
|
|
@@ -28440,13 +28464,14 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
28440
28464
|
legacyResult = diagnosticResult.value.resolved.path;
|
|
28441
28465
|
}
|
|
28442
28466
|
}
|
|
28443
|
-
return
|
|
28467
|
+
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
28468
|
+
moduleName,
|
|
28444
28469
|
(_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
|
|
28445
28470
|
(_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
|
|
28446
28471
|
failedLookupLocations,
|
|
28447
28472
|
affectingLocations,
|
|
28448
28473
|
diagnostics,
|
|
28449
|
-
state
|
|
28474
|
+
state,
|
|
28450
28475
|
legacyResult
|
|
28451
28476
|
);
|
|
28452
28477
|
function tryResolve(extensions2, state2) {
|
|
@@ -28476,16 +28501,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
28476
28501
|
}
|
|
28477
28502
|
resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
28478
28503
|
}
|
|
28479
|
-
|
|
28480
|
-
return void 0;
|
|
28481
|
-
let resolvedValue = resolved2.value;
|
|
28482
|
-
if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {
|
|
28483
|
-
const path2 = realPath(resolvedValue.path, host, traceEnabled);
|
|
28484
|
-
const pathsAreEqual = arePathsEqual(path2, resolvedValue.path, host);
|
|
28485
|
-
const originalPath = pathsAreEqual ? void 0 : resolvedValue.path;
|
|
28486
|
-
resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path2, originalPath };
|
|
28487
|
-
}
|
|
28488
|
-
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
|
|
28504
|
+
return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } };
|
|
28489
28505
|
} else {
|
|
28490
28506
|
const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName);
|
|
28491
28507
|
const resolved2 = nodeLoadModuleByRelativeName(
|
|
@@ -29511,13 +29527,14 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
29511
29527
|
candidateIsFromPackageJsonField: false
|
|
29512
29528
|
};
|
|
29513
29529
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
29514
|
-
return
|
|
29530
|
+
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
29531
|
+
moduleName,
|
|
29515
29532
|
resolved && resolved.value,
|
|
29516
29533
|
(resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
|
|
29517
29534
|
failedLookupLocations,
|
|
29518
29535
|
affectingLocations,
|
|
29519
29536
|
diagnostics,
|
|
29520
|
-
state
|
|
29537
|
+
state
|
|
29521
29538
|
);
|
|
29522
29539
|
function tryResolve(extensions) {
|
|
29523
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.
|
|
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",
|