@html-validate/commitlint-config 3.4.2 → 3.4.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/dist/commitlint.js +1034 -594
- package/package.json +1 -1
package/dist/commitlint.js
CHANGED
|
@@ -19340,6 +19340,7 @@ var require_typescript = __commonJS({
|
|
|
19340
19340
|
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
19341
19341
|
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
19342
19342
|
createProgram: () => createProgram,
|
|
19343
|
+
createProgramDiagnostics: () => createProgramDiagnostics,
|
|
19343
19344
|
createProgramHost: () => createProgramHost,
|
|
19344
19345
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
19345
19346
|
createQueue: () => createQueue,
|
|
@@ -19509,6 +19510,8 @@ var require_typescript = __commonJS({
|
|
|
19509
19510
|
forEachLeadingCommentRange: () => forEachLeadingCommentRange,
|
|
19510
19511
|
forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
|
|
19511
19512
|
forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
|
|
19513
|
+
forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
|
|
19514
|
+
forEachProjectReference: () => forEachProjectReference,
|
|
19512
19515
|
forEachPropertyAssignment: () => forEachPropertyAssignment,
|
|
19513
19516
|
forEachResolvedProjectReference: () => forEachResolvedProjectReference,
|
|
19514
19517
|
forEachReturnStatement: () => forEachReturnStatement,
|
|
@@ -19748,6 +19751,8 @@ var require_typescript = __commonJS({
|
|
|
19748
19751
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
19749
19752
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
19750
19753
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
19754
|
+
getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
|
|
19755
|
+
getLibNameFromLibReference: () => getLibNameFromLibReference,
|
|
19751
19756
|
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
19752
19757
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
19753
19758
|
getLineInfo: () => getLineInfo,
|
|
@@ -19820,6 +19825,8 @@ var require_typescript = __commonJS({
|
|
|
19820
19825
|
getOptionFromName: () => getOptionFromName,
|
|
19821
19826
|
getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
|
|
19822
19827
|
getOptionsNameMap: () => getOptionsNameMap,
|
|
19828
|
+
getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
|
|
19829
|
+
getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
|
|
19823
19830
|
getOrCreateEmitNode: () => getOrCreateEmitNode,
|
|
19824
19831
|
getOrUpdate: () => getOrUpdate,
|
|
19825
19832
|
getOriginalNode: () => getOriginalNode,
|
|
@@ -19856,7 +19863,6 @@ var require_typescript = __commonJS({
|
|
|
19856
19863
|
getPrivateIdentifier: () => getPrivateIdentifier,
|
|
19857
19864
|
getProperties: () => getProperties,
|
|
19858
19865
|
getProperty: () => getProperty,
|
|
19859
|
-
getPropertyArrayElementValue: () => getPropertyArrayElementValue,
|
|
19860
19866
|
getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
|
|
19861
19867
|
getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
|
|
19862
19868
|
getPropertyNameFromType: () => getPropertyNameFromType,
|
|
@@ -20767,6 +20773,7 @@ var require_typescript = __commonJS({
|
|
|
20767
20773
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
20768
20774
|
moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
|
|
20769
20775
|
moduleSpecifiers: () => ts_moduleSpecifiers_exports,
|
|
20776
|
+
moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
|
|
20770
20777
|
moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
|
|
20771
20778
|
moveEmitHelpers: () => moveEmitHelpers,
|
|
20772
20779
|
moveRangeEnd: () => moveRangeEnd,
|
|
@@ -21179,8 +21186,8 @@ var require_typescript = __commonJS({
|
|
|
21179
21186
|
zipWith: () => zipWith
|
|
21180
21187
|
});
|
|
21181
21188
|
module2.exports = __toCommonJS(typescript_exports);
|
|
21182
|
-
var versionMajorMinor = "5.
|
|
21183
|
-
var version = "5.
|
|
21189
|
+
var versionMajorMinor = "5.8";
|
|
21190
|
+
var version = "5.8.2";
|
|
21184
21191
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
21185
21192
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
21186
21193
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -25777,6 +25784,7 @@ ${lanes.join("\n")}
|
|
|
25777
25784
|
ModuleKind3[ModuleKind3["ES2022"] = 7] = "ES2022";
|
|
25778
25785
|
ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext";
|
|
25779
25786
|
ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16";
|
|
25787
|
+
ModuleKind3[ModuleKind3["Node18"] = 101] = "Node18";
|
|
25780
25788
|
ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext";
|
|
25781
25789
|
ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve";
|
|
25782
25790
|
return ModuleKind3;
|
|
@@ -26261,8 +26269,9 @@ ${lanes.join("\n")}
|
|
|
26261
26269
|
OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions";
|
|
26262
26270
|
OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
|
|
26263
26271
|
OuterExpressionKinds2[OuterExpressionKinds2["ExpressionsWithTypeArguments"] = 16] = "ExpressionsWithTypeArguments";
|
|
26264
|
-
OuterExpressionKinds2[OuterExpressionKinds2["
|
|
26265
|
-
OuterExpressionKinds2[OuterExpressionKinds2["
|
|
26272
|
+
OuterExpressionKinds2[OuterExpressionKinds2["Satisfies"] = 32] = "Satisfies";
|
|
26273
|
+
OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 38] = "Assertions";
|
|
26274
|
+
OuterExpressionKinds2[OuterExpressionKinds2["All"] = 63] = "All";
|
|
26266
26275
|
OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = -2147483648] = "ExcludeJSDocTypeAssertion";
|
|
26267
26276
|
return OuterExpressionKinds2;
|
|
26268
26277
|
})(OuterExpressionKinds || {});
|
|
@@ -28075,23 +28084,105 @@ ${lanes.join("\n")}
|
|
|
28075
28084
|
function getNormalizedPathComponents(path14, currentDirectory) {
|
|
28076
28085
|
return reducePathComponents(getPathComponents(path14, currentDirectory));
|
|
28077
28086
|
}
|
|
28078
|
-
function getNormalizedAbsolutePath(
|
|
28079
|
-
|
|
28087
|
+
function getNormalizedAbsolutePath(path14, currentDirectory) {
|
|
28088
|
+
let rootLength = getRootLength(path14);
|
|
28089
|
+
if (rootLength === 0 && currentDirectory) {
|
|
28090
|
+
path14 = combinePaths(currentDirectory, path14);
|
|
28091
|
+
rootLength = getRootLength(path14);
|
|
28092
|
+
} else {
|
|
28093
|
+
path14 = normalizeSlashes(path14);
|
|
28094
|
+
}
|
|
28095
|
+
const simpleNormalized = simpleNormalizePath(path14);
|
|
28096
|
+
if (simpleNormalized !== void 0) {
|
|
28097
|
+
return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
|
|
28098
|
+
}
|
|
28099
|
+
const length2 = path14.length;
|
|
28100
|
+
const root = path14.substring(0, rootLength);
|
|
28101
|
+
let normalized;
|
|
28102
|
+
let index = rootLength;
|
|
28103
|
+
let segmentStart = index;
|
|
28104
|
+
let normalizedUpTo = index;
|
|
28105
|
+
let seenNonDotDotSegment = rootLength !== 0;
|
|
28106
|
+
while (index < length2) {
|
|
28107
|
+
segmentStart = index;
|
|
28108
|
+
let ch = path14.charCodeAt(index);
|
|
28109
|
+
while (ch === 47 && index + 1 < length2) {
|
|
28110
|
+
index++;
|
|
28111
|
+
ch = path14.charCodeAt(index);
|
|
28112
|
+
}
|
|
28113
|
+
if (index > segmentStart) {
|
|
28114
|
+
normalized ?? (normalized = path14.substring(0, segmentStart - 1));
|
|
28115
|
+
segmentStart = index;
|
|
28116
|
+
}
|
|
28117
|
+
let segmentEnd = path14.indexOf(directorySeparator, index + 1);
|
|
28118
|
+
if (segmentEnd === -1) {
|
|
28119
|
+
segmentEnd = length2;
|
|
28120
|
+
}
|
|
28121
|
+
const segmentLength = segmentEnd - segmentStart;
|
|
28122
|
+
if (segmentLength === 1 && path14.charCodeAt(index) === 46) {
|
|
28123
|
+
normalized ?? (normalized = path14.substring(0, normalizedUpTo));
|
|
28124
|
+
} else if (segmentLength === 2 && path14.charCodeAt(index) === 46 && path14.charCodeAt(index + 1) === 46) {
|
|
28125
|
+
if (!seenNonDotDotSegment) {
|
|
28126
|
+
if (normalized !== void 0) {
|
|
28127
|
+
normalized += normalized.length === rootLength ? ".." : "/..";
|
|
28128
|
+
} else {
|
|
28129
|
+
normalizedUpTo = index + 2;
|
|
28130
|
+
}
|
|
28131
|
+
} else if (normalized === void 0) {
|
|
28132
|
+
if (normalizedUpTo - 2 >= 0) {
|
|
28133
|
+
normalized = path14.substring(0, Math.max(rootLength, path14.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
|
|
28134
|
+
} else {
|
|
28135
|
+
normalized = path14.substring(0, normalizedUpTo);
|
|
28136
|
+
}
|
|
28137
|
+
} else {
|
|
28138
|
+
const lastSlash = normalized.lastIndexOf(directorySeparator);
|
|
28139
|
+
if (lastSlash !== -1) {
|
|
28140
|
+
normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
|
|
28141
|
+
} else {
|
|
28142
|
+
normalized = root;
|
|
28143
|
+
}
|
|
28144
|
+
if (normalized.length === rootLength) {
|
|
28145
|
+
seenNonDotDotSegment = rootLength !== 0;
|
|
28146
|
+
}
|
|
28147
|
+
}
|
|
28148
|
+
} else if (normalized !== void 0) {
|
|
28149
|
+
if (normalized.length !== rootLength) {
|
|
28150
|
+
normalized += directorySeparator;
|
|
28151
|
+
}
|
|
28152
|
+
seenNonDotDotSegment = true;
|
|
28153
|
+
normalized += path14.substring(segmentStart, segmentEnd);
|
|
28154
|
+
} else {
|
|
28155
|
+
seenNonDotDotSegment = true;
|
|
28156
|
+
normalizedUpTo = segmentEnd;
|
|
28157
|
+
}
|
|
28158
|
+
index = segmentEnd + 1;
|
|
28159
|
+
}
|
|
28160
|
+
return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path14) : path14);
|
|
28080
28161
|
}
|
|
28081
28162
|
function normalizePath(path14) {
|
|
28082
28163
|
path14 = normalizeSlashes(path14);
|
|
28164
|
+
let normalized = simpleNormalizePath(path14);
|
|
28165
|
+
if (normalized !== void 0) {
|
|
28166
|
+
return normalized;
|
|
28167
|
+
}
|
|
28168
|
+
normalized = getNormalizedAbsolutePath(path14, "");
|
|
28169
|
+
return normalized && hasTrailingDirectorySeparator(path14) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
28170
|
+
}
|
|
28171
|
+
function simpleNormalizePath(path14) {
|
|
28083
28172
|
if (!relativePathSegmentRegExp.test(path14)) {
|
|
28084
28173
|
return path14;
|
|
28085
28174
|
}
|
|
28086
|
-
|
|
28175
|
+
let simplified = path14.replace(/\/\.\//g, "/");
|
|
28176
|
+
if (simplified.startsWith("./")) {
|
|
28177
|
+
simplified = simplified.slice(2);
|
|
28178
|
+
}
|
|
28087
28179
|
if (simplified !== path14) {
|
|
28088
28180
|
path14 = simplified;
|
|
28089
28181
|
if (!relativePathSegmentRegExp.test(path14)) {
|
|
28090
28182
|
return path14;
|
|
28091
28183
|
}
|
|
28092
28184
|
}
|
|
28093
|
-
|
|
28094
|
-
return normalized && hasTrailingDirectorySeparator(path14) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
28185
|
+
return void 0;
|
|
28095
28186
|
}
|
|
28096
28187
|
function getPathWithoutRoot(pathComponents2) {
|
|
28097
28188
|
if (pathComponents2.length === 0) return "";
|
|
@@ -28517,6 +28608,7 @@ ${lanes.join("\n")}
|
|
|
28517
28608
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
28518
28609
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
28519
28610
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
|
|
28611
|
+
This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
|
|
28520
28612
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
28521
28613
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
28522
28614
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -28531,8 +28623,8 @@ ${lanes.join("\n")}
|
|
|
28531
28623
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
28532
28624
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
|
|
28533
28625
|
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
28534
|
-
|
|
28535
|
-
|
|
28626
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."),
|
|
28627
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."),
|
|
28536
28628
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
28537
28629
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
|
|
28538
28630
|
String_literal_with_double_quotes_expected: diag(1327, 1, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -28549,7 +28641,7 @@ ${lanes.join("\n")}
|
|
|
28549
28641
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1, "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."),
|
|
28550
28642
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1, "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}')'?"),
|
|
28551
28643
|
Class_constructor_may_not_be_an_accessor: diag(1341, 1, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
|
|
28552
|
-
|
|
28644
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1, "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', 'node18', or 'nodenext'."),
|
|
28553
28645
|
A_label_is_not_allowed_here: diag(1344, 1, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
28554
28646
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
28555
28647
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -28579,7 +28671,7 @@ ${lanes.join("\n")}
|
|
|
28579
28671
|
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: diag(1375, 1, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'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."),
|
|
28580
28672
|
_0_was_imported_here: diag(1376, 3, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
28581
28673
|
_0_was_exported_here: diag(1377, 3, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
28582
|
-
|
|
28674
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
28583
28675
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
|
|
28584
28676
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
|
|
28585
28677
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -28630,7 +28722,7 @@ ${lanes.join("\n")}
|
|
|
28630
28722
|
File_redirects_to_file_0: diag(1429, 3, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
28631
28723
|
The_file_is_in_the_program_because_Colon: diag(1430, 3, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
28632
28724
|
for_await_loops_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: diag(1431, 1, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops 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."),
|
|
28633
|
-
|
|
28725
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
28634
28726
|
Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
|
|
28635
28727
|
Unexpected_keyword_or_identifier: diag(1434, 1, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
28636
28728
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -29272,9 +29364,9 @@ ${lanes.join("\n")}
|
|
|
29272
29364
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
29273
29365
|
Namespace_name_cannot_be_0: diag(2819, 1, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
29274
29366
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
29275
|
-
|
|
29367
|
+
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
|
|
29276
29368
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
29277
|
-
|
|
29369
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
|
|
29278
29370
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
29279
29371
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1, "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 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
29280
29372
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1, "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 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -29294,7 +29386,7 @@ ${lanes.join("\n")}
|
|
|
29294
29386
|
The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
|
|
29295
29387
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
29296
29388
|
await_using_statements_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: diag(2853, 1, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements 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."),
|
|
29297
|
-
|
|
29389
|
+
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
29298
29390
|
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
29299
29391
|
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
29300
29392
|
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
@@ -29320,6 +29412,7 @@ ${lanes.join("\n")}
|
|
|
29320
29412
|
This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
|
|
29321
29413
|
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
|
29322
29414
|
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
|
29415
|
+
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
|
29323
29416
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
29324
29417
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1, "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}'."),
|
|
29325
29418
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1, "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}'."),
|
|
@@ -29429,6 +29522,8 @@ ${lanes.join("\n")}
|
|
|
29429
29522
|
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, 1, "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'."),
|
|
29430
29523
|
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
29431
29524
|
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
|
|
29525
|
+
This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
|
|
29526
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
|
|
29432
29527
|
The_current_host_does_not_support_the_0_option: diag(5001, 1, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
29433
29528
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
29434
29529
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -30001,11 +30096,13 @@ ${lanes.join("\n")}
|
|
|
30001
30096
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
30002
30097
|
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
|
|
30003
30098
|
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
|
|
30099
|
+
Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
|
|
30004
30100
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
30005
30101
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
|
30006
30102
|
Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
|
|
30007
30103
|
Check_side_effect_imports: diag(6806, 3, "Check_side_effect_imports_6806", "Check side effect imports."),
|
|
30008
30104
|
This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
|
|
30105
|
+
Enable_lib_replacement: diag(6808, 3, "Enable_lib_replacement_6808", "Enable lib replacement."),
|
|
30009
30106
|
one_of_Colon: diag(6900, 3, "one_of_Colon_6900", "one of:"),
|
|
30010
30107
|
one_or_more_Colon: diag(6901, 3, "one_or_more_Colon_6901", "one or more:"),
|
|
30011
30108
|
type_Colon: diag(6902, 3, "type_Colon_6902", "type:"),
|
|
@@ -36102,6 +36199,9 @@ ${lanes.join("\n")}
|
|
|
36102
36199
|
"trunc",
|
|
36103
36200
|
"fround",
|
|
36104
36201
|
"cbrt"
|
|
36202
|
+
],
|
|
36203
|
+
esnext: [
|
|
36204
|
+
"f16round"
|
|
36105
36205
|
]
|
|
36106
36206
|
})),
|
|
36107
36207
|
Map: new Map(Object.entries({
|
|
@@ -36271,6 +36371,10 @@ ${lanes.join("\n")}
|
|
|
36271
36371
|
"setBigUint64",
|
|
36272
36372
|
"getBigInt64",
|
|
36273
36373
|
"getBigUint64"
|
|
36374
|
+
],
|
|
36375
|
+
esnext: [
|
|
36376
|
+
"setFloat16",
|
|
36377
|
+
"getFloat16"
|
|
36274
36378
|
]
|
|
36275
36379
|
})),
|
|
36276
36380
|
BigInt: new Map(Object.entries({
|
|
@@ -36374,6 +36478,9 @@ ${lanes.join("\n")}
|
|
|
36374
36478
|
"with"
|
|
36375
36479
|
]
|
|
36376
36480
|
})),
|
|
36481
|
+
Float16Array: new Map(Object.entries({
|
|
36482
|
+
esnext: emptyArray
|
|
36483
|
+
})),
|
|
36377
36484
|
Float32Array: new Map(Object.entries({
|
|
36378
36485
|
es2022: [
|
|
36379
36486
|
"at"
|
|
@@ -36565,7 +36672,7 @@ ${lanes.join("\n")}
|
|
|
36565
36672
|
return (_a2 = symbol.declarations) == null ? void 0 : _a2.find((d) => !isExternalModuleAugmentation(d) && !(isModuleDeclaration(d) && isGlobalScopeAugmentation(d)));
|
|
36566
36673
|
}
|
|
36567
36674
|
function isCommonJSContainingModuleKind(kind) {
|
|
36568
|
-
return kind === 1 ||
|
|
36675
|
+
return kind === 1 || 100 <= kind && kind <= 199;
|
|
36569
36676
|
}
|
|
36570
36677
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
36571
36678
|
return isExternalModule(node) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator;
|
|
@@ -37287,9 +37394,6 @@ ${lanes.join("\n")}
|
|
|
37287
37394
|
return key === propName || key2 && key2 === propName ? callback(property) : void 0;
|
|
37288
37395
|
});
|
|
37289
37396
|
}
|
|
37290
|
-
function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
|
|
37291
|
-
return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
|
|
37292
|
-
}
|
|
37293
37397
|
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
|
|
37294
37398
|
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
|
|
37295
37399
|
const expression = tsConfigSourceFile.statements[0].expression;
|
|
@@ -41245,7 +41349,7 @@ ${lanes.join("\n")}
|
|
|
41245
41349
|
dependencies: ["module"],
|
|
41246
41350
|
computeValue: (compilerOptions) => {
|
|
41247
41351
|
const target = compilerOptions.target === 0 ? void 0 : compilerOptions.target;
|
|
41248
|
-
return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 199 && 99 || 1);
|
|
41352
|
+
return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 101 && 9 || compilerOptions.module === 199 && 99 || 1);
|
|
41249
41353
|
}
|
|
41250
41354
|
},
|
|
41251
41355
|
module: {
|
|
@@ -41264,6 +41368,7 @@ ${lanes.join("\n")}
|
|
|
41264
41368
|
moduleResolution = 2;
|
|
41265
41369
|
break;
|
|
41266
41370
|
case 100:
|
|
41371
|
+
case 101:
|
|
41267
41372
|
moduleResolution = 3;
|
|
41268
41373
|
break;
|
|
41269
41374
|
case 199:
|
|
@@ -41283,7 +41388,11 @@ ${lanes.join("\n")}
|
|
|
41283
41388
|
moduleDetection: {
|
|
41284
41389
|
dependencies: ["module", "target"],
|
|
41285
41390
|
computeValue: (compilerOptions) => {
|
|
41286
|
-
|
|
41391
|
+
if (compilerOptions.moduleDetection !== void 0) {
|
|
41392
|
+
return compilerOptions.moduleDetection;
|
|
41393
|
+
}
|
|
41394
|
+
const moduleKind = _computedOptions.module.computeValue(compilerOptions);
|
|
41395
|
+
return 100 <= moduleKind && moduleKind <= 199 ? 3 : 2;
|
|
41287
41396
|
}
|
|
41288
41397
|
},
|
|
41289
41398
|
isolatedModules: {
|
|
@@ -41300,6 +41409,7 @@ ${lanes.join("\n")}
|
|
|
41300
41409
|
}
|
|
41301
41410
|
switch (_computedOptions.module.computeValue(compilerOptions)) {
|
|
41302
41411
|
case 100:
|
|
41412
|
+
case 101:
|
|
41303
41413
|
case 199:
|
|
41304
41414
|
case 200:
|
|
41305
41415
|
return true;
|
|
@@ -41493,6 +41603,9 @@ ${lanes.join("\n")}
|
|
|
41493
41603
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
41494
41604
|
return moduleResolution >= 3 && moduleResolution <= 99 || moduleResolution === 100;
|
|
41495
41605
|
}
|
|
41606
|
+
function moduleSupportsImportAttributes(moduleKind) {
|
|
41607
|
+
return 101 <= moduleKind && moduleKind <= 199 || moduleKind === 200 || moduleKind === 99;
|
|
41608
|
+
}
|
|
41496
41609
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
41497
41610
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
41498
41611
|
}
|
|
@@ -42338,7 +42451,7 @@ ${lanes.join("\n")}
|
|
|
42338
42451
|
return success && result === 10 && scanner2.getTokenEnd() === s.length + 1 && !(flags & 512) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
|
|
42339
42452
|
}
|
|
42340
42453
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
42341
|
-
return !!(useSite.flags & 33554432) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
42454
|
+
return !!(useSite.flags & 33554432) || isInJSDoc(useSite) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
42342
42455
|
}
|
|
42343
42456
|
function isShorthandPropertyNameUseSite(useSite) {
|
|
42344
42457
|
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
|
|
@@ -43559,6 +43672,64 @@ ${lanes.join("\n")}
|
|
|
43559
43672
|
function isNewScopeNode(node) {
|
|
43560
43673
|
return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
|
|
43561
43674
|
}
|
|
43675
|
+
function getLibNameFromLibReference(libReference) {
|
|
43676
|
+
return toFileNameLowerCase(libReference.fileName);
|
|
43677
|
+
}
|
|
43678
|
+
function getLibFileNameFromLibReference(libReference) {
|
|
43679
|
+
const libName = getLibNameFromLibReference(libReference);
|
|
43680
|
+
return libMap.get(libName);
|
|
43681
|
+
}
|
|
43682
|
+
function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
43683
|
+
return forEachProjectReference(
|
|
43684
|
+
/*projectReferences*/
|
|
43685
|
+
void 0,
|
|
43686
|
+
resolvedProjectReferences,
|
|
43687
|
+
(resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
|
|
43688
|
+
);
|
|
43689
|
+
}
|
|
43690
|
+
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
|
43691
|
+
let seenResolvedRefs;
|
|
43692
|
+
return worker(
|
|
43693
|
+
projectReferences,
|
|
43694
|
+
resolvedProjectReferences,
|
|
43695
|
+
/*parent*/
|
|
43696
|
+
void 0
|
|
43697
|
+
);
|
|
43698
|
+
function worker(projectReferences2, resolvedProjectReferences2, parent2) {
|
|
43699
|
+
if (cbRef) {
|
|
43700
|
+
const result = cbRef(projectReferences2, parent2);
|
|
43701
|
+
if (result) return result;
|
|
43702
|
+
}
|
|
43703
|
+
let skipChildren;
|
|
43704
|
+
return forEach(
|
|
43705
|
+
resolvedProjectReferences2,
|
|
43706
|
+
(resolvedRef, index) => {
|
|
43707
|
+
if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
|
|
43708
|
+
(skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
|
|
43709
|
+
return void 0;
|
|
43710
|
+
}
|
|
43711
|
+
const result = cbResolvedRef(resolvedRef, parent2, index);
|
|
43712
|
+
if (result || !resolvedRef) return result;
|
|
43713
|
+
(seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
|
|
43714
|
+
}
|
|
43715
|
+
) || forEach(
|
|
43716
|
+
resolvedProjectReferences2,
|
|
43717
|
+
(resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
|
|
43718
|
+
);
|
|
43719
|
+
}
|
|
43720
|
+
}
|
|
43721
|
+
function getOptionsSyntaxByArrayElementValue(optionsObject, name, value2) {
|
|
43722
|
+
return optionsObject && getPropertyArrayElementValue(optionsObject, name, value2);
|
|
43723
|
+
}
|
|
43724
|
+
function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
|
|
43725
|
+
return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
|
|
43726
|
+
}
|
|
43727
|
+
function getOptionsSyntaxByValue(optionsObject, name, value2) {
|
|
43728
|
+
return forEachOptionsSyntaxByName(optionsObject, name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value2 ? property.initializer : void 0);
|
|
43729
|
+
}
|
|
43730
|
+
function forEachOptionsSyntaxByName(optionsObject, name, callback) {
|
|
43731
|
+
return forEachPropertyAssignment(optionsObject, name, callback);
|
|
43732
|
+
}
|
|
43562
43733
|
function createBaseNodeFactory() {
|
|
43563
43734
|
let NodeConstructor2;
|
|
43564
43735
|
let TokenConstructor2;
|
|
@@ -46666,6 +46837,8 @@ ${lanes.join("\n")}
|
|
|
46666
46837
|
);
|
|
46667
46838
|
node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse);
|
|
46668
46839
|
node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse);
|
|
46840
|
+
node.flowNodeWhenFalse = void 0;
|
|
46841
|
+
node.flowNodeWhenTrue = void 0;
|
|
46669
46842
|
return node;
|
|
46670
46843
|
}
|
|
46671
46844
|
function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) {
|
|
@@ -48781,7 +48954,7 @@ ${lanes.join("\n")}
|
|
|
48781
48954
|
function isIgnorableParen(node) {
|
|
48782
48955
|
return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
|
|
48783
48956
|
}
|
|
48784
|
-
function restoreOuterExpressions(outerExpression, innerExpression, kinds =
|
|
48957
|
+
function restoreOuterExpressions(outerExpression, innerExpression, kinds = 63) {
|
|
48785
48958
|
if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
|
|
48786
48959
|
return updateOuterExpression(
|
|
48787
48960
|
outerExpression,
|
|
@@ -48829,7 +49002,7 @@ ${lanes.join("\n")}
|
|
|
48829
49002
|
function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) {
|
|
48830
49003
|
const callee = skipOuterExpressions(
|
|
48831
49004
|
expression,
|
|
48832
|
-
|
|
49005
|
+
63
|
|
48833
49006
|
/* All */
|
|
48834
49007
|
);
|
|
48835
49008
|
let thisArg;
|
|
@@ -51864,7 +52037,7 @@ ${lanes.join("\n")}
|
|
|
51864
52037
|
Debug.assertIsDefined(type);
|
|
51865
52038
|
return type;
|
|
51866
52039
|
}
|
|
51867
|
-
function isOuterExpression(node, kinds =
|
|
52040
|
+
function isOuterExpression(node, kinds = 63) {
|
|
51868
52041
|
switch (node.kind) {
|
|
51869
52042
|
case 217:
|
|
51870
52043
|
if (kinds & -2147483648 && isJSDocTypeAssertion(node)) {
|
|
@@ -51873,8 +52046,9 @@ ${lanes.join("\n")}
|
|
|
51873
52046
|
return (kinds & 1) !== 0;
|
|
51874
52047
|
case 216:
|
|
51875
52048
|
case 234:
|
|
51876
|
-
case 238:
|
|
51877
52049
|
return (kinds & 2) !== 0;
|
|
52050
|
+
case 238:
|
|
52051
|
+
return (kinds & (2 | 32)) !== 0;
|
|
51878
52052
|
case 233:
|
|
51879
52053
|
return (kinds & 16) !== 0;
|
|
51880
52054
|
case 235:
|
|
@@ -51884,13 +52058,13 @@ ${lanes.join("\n")}
|
|
|
51884
52058
|
}
|
|
51885
52059
|
return false;
|
|
51886
52060
|
}
|
|
51887
|
-
function skipOuterExpressions(node, kinds =
|
|
52061
|
+
function skipOuterExpressions(node, kinds = 63) {
|
|
51888
52062
|
while (isOuterExpression(node, kinds)) {
|
|
51889
52063
|
node = node.expression;
|
|
51890
52064
|
}
|
|
51891
52065
|
return node;
|
|
51892
52066
|
}
|
|
51893
|
-
function walkUpOuterExpressions(node, kinds =
|
|
52067
|
+
function walkUpOuterExpressions(node, kinds = 63) {
|
|
51894
52068
|
let parent2 = node.parent;
|
|
51895
52069
|
while (isOuterExpression(parent2, kinds)) {
|
|
51896
52070
|
parent2 = parent2.parent;
|
|
@@ -61256,6 +61430,7 @@ ${lanes.join("\n")}
|
|
|
61256
61430
|
const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
|
|
61257
61431
|
const res = finishNode(node, pos);
|
|
61258
61432
|
if (usedBrace) {
|
|
61433
|
+
skipWhitespace();
|
|
61259
61434
|
parseExpected(
|
|
61260
61435
|
20
|
|
61261
61436
|
/* CloseBraceToken */
|
|
@@ -62352,6 +62527,8 @@ ${lanes.join("\n")}
|
|
|
62352
62527
|
["esnext.regexp", "lib.es2024.regexp.d.ts"],
|
|
62353
62528
|
["esnext.string", "lib.es2024.string.d.ts"],
|
|
62354
62529
|
["esnext.iterator", "lib.esnext.iterator.d.ts"],
|
|
62530
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
62531
|
+
["esnext.float16", "lib.esnext.float16.d.ts"],
|
|
62355
62532
|
["decorators", "lib.decorators.d.ts"],
|
|
62356
62533
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
62357
62534
|
];
|
|
@@ -62686,6 +62863,7 @@ ${lanes.join("\n")}
|
|
|
62686
62863
|
es2022: 7,
|
|
62687
62864
|
esnext: 99,
|
|
62688
62865
|
node16: 100,
|
|
62866
|
+
node18: 101,
|
|
62689
62867
|
nodenext: 199,
|
|
62690
62868
|
preserve: 200
|
|
62691
62869
|
/* Preserve */
|
|
@@ -62941,6 +63119,23 @@ ${lanes.join("\n")}
|
|
|
62941
63119
|
affectsBuildInfo: true,
|
|
62942
63120
|
affectsSemanticDiagnostics: true
|
|
62943
63121
|
},
|
|
63122
|
+
{
|
|
63123
|
+
name: "erasableSyntaxOnly",
|
|
63124
|
+
type: "boolean",
|
|
63125
|
+
category: Diagnostics.Interop_Constraints,
|
|
63126
|
+
description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
|
|
63127
|
+
defaultValueDescription: false,
|
|
63128
|
+
affectsBuildInfo: true,
|
|
63129
|
+
affectsSemanticDiagnostics: true
|
|
63130
|
+
},
|
|
63131
|
+
{
|
|
63132
|
+
name: "libReplacement",
|
|
63133
|
+
type: "boolean",
|
|
63134
|
+
affectsProgramStructure: true,
|
|
63135
|
+
category: Diagnostics.Language_and_Environment,
|
|
63136
|
+
description: Diagnostics.Enable_lib_replacement,
|
|
63137
|
+
defaultValueDescription: true
|
|
63138
|
+
},
|
|
62944
63139
|
// Strict Type Checks
|
|
62945
63140
|
{
|
|
62946
63141
|
name: "strict",
|
|
@@ -67220,9 +67415,7 @@ ${lanes.join("\n")}
|
|
|
67220
67415
|
}
|
|
67221
67416
|
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
|
|
67222
67417
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
67223
|
-
|
|
67224
|
-
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
67225
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
67418
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
|
|
67226
67419
|
}
|
|
67227
67420
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache2, resolveJs) {
|
|
67228
67421
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -67240,8 +67433,7 @@ ${lanes.join("\n")}
|
|
|
67240
67433
|
/*onlyRecordFailures*/
|
|
67241
67434
|
false,
|
|
67242
67435
|
loadPackageJsonMainState,
|
|
67243
|
-
packageJsonInfo
|
|
67244
|
-
getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState)
|
|
67436
|
+
packageJsonInfo
|
|
67245
67437
|
);
|
|
67246
67438
|
entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path);
|
|
67247
67439
|
if (features & 8 && packageJsonInfo.contents.packageJsonContent.exports) {
|
|
@@ -67452,13 +67644,14 @@ ${lanes.join("\n")}
|
|
|
67452
67644
|
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
67453
67645
|
}
|
|
67454
67646
|
}
|
|
67455
|
-
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state,
|
|
67647
|
+
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
|
|
67648
|
+
const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
|
|
67456
67649
|
let packageFile;
|
|
67457
|
-
if (
|
|
67650
|
+
if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
|
|
67458
67651
|
if (state.isConfigLookup) {
|
|
67459
|
-
packageFile = readPackageJsonTSConfigField(
|
|
67652
|
+
packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
|
|
67460
67653
|
} else {
|
|
67461
|
-
packageFile = extensions & 4 && readPackageJsonTypesFields(
|
|
67654
|
+
packageFile = extensions & 4 && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 | 4) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
|
|
67462
67655
|
}
|
|
67463
67656
|
}
|
|
67464
67657
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
@@ -67477,7 +67670,7 @@ ${lanes.join("\n")}
|
|
|
67477
67670
|
const features = state2.features;
|
|
67478
67671
|
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
67479
67672
|
state2.candidateIsFromPackageJsonField = true;
|
|
67480
|
-
if ((
|
|
67673
|
+
if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
|
|
67481
67674
|
state2.features &= ~32;
|
|
67482
67675
|
}
|
|
67483
67676
|
const result = nodeLoadModuleByRelativeName(
|
|
@@ -67748,6 +67941,7 @@ ${lanes.join("\n")}
|
|
|
67748
67941
|
function getLoadModuleFromTargetExportOrImport(extensions, state, cache2, redirectedReference, moduleName2, scope, isImports) {
|
|
67749
67942
|
return loadModuleFromTargetExportOrImport;
|
|
67750
67943
|
function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
|
|
67944
|
+
var _a2, _b2;
|
|
67751
67945
|
if (typeof target === "string") {
|
|
67752
67946
|
if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
|
|
67753
67947
|
if (state.traceEnabled) {
|
|
@@ -67776,6 +67970,8 @@ ${lanes.join("\n")}
|
|
|
67776
67970
|
redirectedReference,
|
|
67777
67971
|
state.conditions
|
|
67778
67972
|
);
|
|
67973
|
+
(_a2 = state.failedLookupLocations) == null ? void 0 : _a2.push(...result.failedLookupLocations ?? emptyArray);
|
|
67974
|
+
(_b2 = state.affectingLocations) == null ? void 0 : _b2.push(...result.affectingLocations ?? emptyArray);
|
|
67779
67975
|
return toSearchResult(
|
|
67780
67976
|
result.resolvedModule ? {
|
|
67781
67977
|
path: result.resolvedModule.resolvedFileName,
|
|
@@ -67885,20 +68081,20 @@ ${lanes.join("\n")}
|
|
|
67885
68081
|
void 0
|
|
67886
68082
|
);
|
|
67887
68083
|
function toAbsolutePath(path14) {
|
|
67888
|
-
var
|
|
68084
|
+
var _a22, _b22;
|
|
67889
68085
|
if (path14 === void 0) return path14;
|
|
67890
|
-
return getNormalizedAbsolutePath(path14, (
|
|
68086
|
+
return getNormalizedAbsolutePath(path14, (_b22 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b22.call(_a22));
|
|
67891
68087
|
}
|
|
67892
68088
|
function combineDirectoryPath(root, dir) {
|
|
67893
68089
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
67894
68090
|
}
|
|
67895
68091
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
67896
|
-
var
|
|
68092
|
+
var _a22, _b22, _c2, _d;
|
|
67897
68093
|
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
67898
68094
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
67899
68095
|
const commonSourceDirGuesses = [];
|
|
67900
68096
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
67901
|
-
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((
|
|
68097
|
+
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b22 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b22.call(_a22)) || "", getCanonicalFileName));
|
|
67902
68098
|
commonSourceDirGuesses.push(commonDir);
|
|
67903
68099
|
} else if (state.requestContainingDirectory) {
|
|
67904
68100
|
const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
|
|
@@ -67963,8 +68159,8 @@ ${lanes.join("\n")}
|
|
|
67963
68159
|
}
|
|
67964
68160
|
return void 0;
|
|
67965
68161
|
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
|
|
67966
|
-
var
|
|
67967
|
-
const currentDir = state.compilerOptions.configFile ? ((
|
|
68162
|
+
var _a3, _b3;
|
|
68163
|
+
const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
|
|
67968
68164
|
const candidateDirectories = [];
|
|
67969
68165
|
if (state.compilerOptions.declarationDir) {
|
|
67970
68166
|
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
|
|
@@ -68011,7 +68207,7 @@ ${lanes.join("\n")}
|
|
|
68011
68207
|
);
|
|
68012
68208
|
}
|
|
68013
68209
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName2, directory, state, typesScopeOnly, cache2, redirectedReference) {
|
|
68014
|
-
const mode = state.features === 0 ? void 0 : state.features & 32 ? 99 : 1;
|
|
68210
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 || state.conditions.includes("import") ? 99 : 1;
|
|
68015
68211
|
const priorityExtensions = extensions & (1 | 4);
|
|
68016
68212
|
const secondaryExtensions = extensions & ~(1 | 4);
|
|
68017
68213
|
if (priorityExtensions) {
|
|
@@ -68089,8 +68285,7 @@ ${lanes.join("\n")}
|
|
|
68089
68285
|
candidate,
|
|
68090
68286
|
!nodeModulesDirectoryExists,
|
|
68091
68287
|
state,
|
|
68092
|
-
packageInfo
|
|
68093
|
-
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
68288
|
+
packageInfo
|
|
68094
68289
|
);
|
|
68095
68290
|
return withPackageId(packageInfo, fromDirectory, state);
|
|
68096
68291
|
}
|
|
@@ -68100,10 +68295,9 @@ ${lanes.join("\n")}
|
|
|
68100
68295
|
candidate2,
|
|
68101
68296
|
onlyRecordFailures,
|
|
68102
68297
|
state2,
|
|
68103
|
-
packageInfo
|
|
68104
|
-
packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
|
|
68298
|
+
packageInfo
|
|
68105
68299
|
);
|
|
68106
|
-
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
|
|
68300
|
+
if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
|
|
68107
68301
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
68108
68302
|
}
|
|
68109
68303
|
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
@@ -68554,6 +68748,7 @@ ${lanes.join("\n")}
|
|
|
68554
68748
|
var preSwitchCaseFlow;
|
|
68555
68749
|
var activeLabelList;
|
|
68556
68750
|
var hasExplicitReturn;
|
|
68751
|
+
var inReturnPosition;
|
|
68557
68752
|
var hasFlowEffects;
|
|
68558
68753
|
var emitFlags;
|
|
68559
68754
|
var inStrictMode;
|
|
@@ -68626,6 +68821,7 @@ ${lanes.join("\n")}
|
|
|
68626
68821
|
currentExceptionTarget = void 0;
|
|
68627
68822
|
activeLabelList = void 0;
|
|
68628
68823
|
hasExplicitReturn = false;
|
|
68824
|
+
inReturnPosition = false;
|
|
68629
68825
|
hasFlowEffects = false;
|
|
68630
68826
|
inAssignmentPattern = false;
|
|
68631
68827
|
emitFlags = 0;
|
|
@@ -68878,6 +69074,8 @@ ${lanes.join("\n")}
|
|
|
68878
69074
|
const saveContainer = container;
|
|
68879
69075
|
const saveThisParentContainer = thisParentContainer;
|
|
68880
69076
|
const savedBlockScopeContainer = blockScopeContainer;
|
|
69077
|
+
const savedInReturnPosition = inReturnPosition;
|
|
69078
|
+
if (node.kind === 219 && node.body.kind !== 241) inReturnPosition = true;
|
|
68881
69079
|
if (containerFlags & 1) {
|
|
68882
69080
|
if (node.kind !== 219) {
|
|
68883
69081
|
thisParentContainer = container;
|
|
@@ -68959,6 +69157,7 @@ ${lanes.join("\n")}
|
|
|
68959
69157
|
} else {
|
|
68960
69158
|
bindChildren(node);
|
|
68961
69159
|
}
|
|
69160
|
+
inReturnPosition = savedInReturnPosition;
|
|
68962
69161
|
container = saveContainer;
|
|
68963
69162
|
thisParentContainer = saveThisParentContainer;
|
|
68964
69163
|
blockScopeContainer = savedBlockScopeContainer;
|
|
@@ -68980,6 +69179,9 @@ ${lanes.join("\n")}
|
|
|
68980
69179
|
const saveInAssignmentPattern = inAssignmentPattern;
|
|
68981
69180
|
inAssignmentPattern = false;
|
|
68982
69181
|
if (checkUnreachable(node)) {
|
|
69182
|
+
if (canHaveFlowNode(node) && node.flowNode) {
|
|
69183
|
+
node.flowNode = void 0;
|
|
69184
|
+
}
|
|
68983
69185
|
bindEachChild(node);
|
|
68984
69186
|
bindJSDoc(node);
|
|
68985
69187
|
inAssignmentPattern = saveInAssignmentPattern;
|
|
@@ -69175,7 +69377,9 @@ ${lanes.join("\n")}
|
|
|
69175
69377
|
case 36:
|
|
69176
69378
|
case 37:
|
|
69177
69379
|
case 38:
|
|
69178
|
-
|
|
69380
|
+
const left2 = skipParentheses(expr.left);
|
|
69381
|
+
const right2 = skipParentheses(expr.right);
|
|
69382
|
+
return isNarrowableOperand(left2) || isNarrowableOperand(right2) || isNarrowingTypeofOperands(right2, left2) || isNarrowingTypeofOperands(left2, right2) || (isBooleanLiteral(right2) && isNarrowingExpression(left2) || isBooleanLiteral(left2) && isNarrowingExpression(right2));
|
|
69179
69383
|
case 104:
|
|
69180
69384
|
return isNarrowableOperand(expr.left);
|
|
69181
69385
|
case 103:
|
|
@@ -69367,13 +69571,16 @@ ${lanes.join("\n")}
|
|
|
69367
69571
|
function bindForStatement(node) {
|
|
69368
69572
|
const preLoopLabel = setContinueTarget(node, createLoopLabel());
|
|
69369
69573
|
const preBodyLabel = createBranchLabel();
|
|
69574
|
+
const preIncrementorLabel = createBranchLabel();
|
|
69370
69575
|
const postLoopLabel = createBranchLabel();
|
|
69371
69576
|
bind(node.initializer);
|
|
69372
69577
|
addAntecedent(preLoopLabel, currentFlow);
|
|
69373
69578
|
currentFlow = preLoopLabel;
|
|
69374
69579
|
bindCondition(node.condition, preBodyLabel, postLoopLabel);
|
|
69375
69580
|
currentFlow = finishFlowLabel(preBodyLabel);
|
|
69376
|
-
bindIterativeStatement(node.statement, postLoopLabel,
|
|
69581
|
+
bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
|
|
69582
|
+
addAntecedent(preIncrementorLabel, currentFlow);
|
|
69583
|
+
currentFlow = finishFlowLabel(preIncrementorLabel);
|
|
69377
69584
|
bind(node.incrementor);
|
|
69378
69585
|
addAntecedent(preLoopLabel, currentFlow);
|
|
69379
69586
|
currentFlow = finishFlowLabel(postLoopLabel);
|
|
@@ -69410,7 +69617,10 @@ ${lanes.join("\n")}
|
|
|
69410
69617
|
currentFlow = finishFlowLabel(postIfLabel);
|
|
69411
69618
|
}
|
|
69412
69619
|
function bindReturnOrThrow(node) {
|
|
69620
|
+
const savedInReturnPosition = inReturnPosition;
|
|
69621
|
+
inReturnPosition = true;
|
|
69413
69622
|
bind(node.expression);
|
|
69623
|
+
inReturnPosition = savedInReturnPosition;
|
|
69414
69624
|
if (node.kind === 253) {
|
|
69415
69625
|
hasExplicitReturn = true;
|
|
69416
69626
|
if (currentReturnTarget) {
|
|
@@ -69775,10 +69985,16 @@ ${lanes.join("\n")}
|
|
|
69775
69985
|
hasFlowEffects = false;
|
|
69776
69986
|
bindCondition(node.condition, trueLabel, falseLabel);
|
|
69777
69987
|
currentFlow = finishFlowLabel(trueLabel);
|
|
69988
|
+
if (inReturnPosition) {
|
|
69989
|
+
node.flowNodeWhenTrue = currentFlow;
|
|
69990
|
+
}
|
|
69778
69991
|
bind(node.questionToken);
|
|
69779
69992
|
bind(node.whenTrue);
|
|
69780
69993
|
addAntecedent(postExpressionLabel, currentFlow);
|
|
69781
69994
|
currentFlow = finishFlowLabel(falseLabel);
|
|
69995
|
+
if (inReturnPosition) {
|
|
69996
|
+
node.flowNodeWhenFalse = currentFlow;
|
|
69997
|
+
}
|
|
69782
69998
|
bind(node.colonToken);
|
|
69783
69999
|
bind(node.whenFalse);
|
|
69784
70000
|
addAntecedent(postExpressionLabel, currentFlow);
|
|
@@ -73502,6 +73718,7 @@ ${lanes.join("\n")}
|
|
|
73502
73718
|
getNumberLiteralType,
|
|
73503
73719
|
getBigIntType: () => bigintType,
|
|
73504
73720
|
getBigIntLiteralType,
|
|
73721
|
+
getUnknownType: () => unknownType,
|
|
73505
73722
|
createPromiseType,
|
|
73506
73723
|
createArrayType,
|
|
73507
73724
|
getElementTypeOfArrayType,
|
|
@@ -73622,8 +73839,13 @@ ${lanes.join("\n")}
|
|
|
73622
73839
|
getMemberOverrideModifierStatus,
|
|
73623
73840
|
isTypeParameterPossiblyReferenced,
|
|
73624
73841
|
typeHasCallOrConstructSignatures,
|
|
73625
|
-
getSymbolFlags
|
|
73842
|
+
getSymbolFlags,
|
|
73843
|
+
getTypeArgumentsForResolvedSignature
|
|
73626
73844
|
};
|
|
73845
|
+
function getTypeArgumentsForResolvedSignature(signature) {
|
|
73846
|
+
if (signature.mapper === void 0) return void 0;
|
|
73847
|
+
return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
|
|
73848
|
+
}
|
|
73627
73849
|
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
73628
73850
|
const candidatesSet = /* @__PURE__ */ new Set();
|
|
73629
73851
|
const candidates = [];
|
|
@@ -75104,9 +75326,9 @@ ${lanes.join("\n")}
|
|
|
75104
75326
|
const containerKind = grandparent.parent.kind;
|
|
75105
75327
|
if (containerKind === 264 && heritageKind === 96) {
|
|
75106
75328
|
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
75107
|
-
} else if (
|
|
75329
|
+
} else if (isClassLike(grandparent.parent) && heritageKind === 96) {
|
|
75108
75330
|
error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
|
|
75109
|
-
} else if (
|
|
75331
|
+
} else if (isClassLike(grandparent.parent) && heritageKind === 119) {
|
|
75110
75332
|
error2(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
75111
75333
|
}
|
|
75112
75334
|
} else {
|
|
@@ -76320,7 +76542,7 @@ ${lanes.join("\n")}
|
|
|
76320
76542
|
moduleReference
|
|
76321
76543
|
);
|
|
76322
76544
|
}
|
|
76323
|
-
if (errorNode && (
|
|
76545
|
+
if (errorNode && (moduleKind === 100 || moduleKind === 101)) {
|
|
76324
76546
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
76325
76547
|
const overrideHost = findAncestor(location, (l2) => isImportTypeNode(l2) || isExportDeclaration(l2) || isImportDeclaration(l2) || isJSDocImportTag(l2));
|
|
76326
76548
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -77656,12 +77878,7 @@ ${lanes.join("\n")}
|
|
|
77656
77878
|
enterNewScope(context, node) {
|
|
77657
77879
|
if (isFunctionLike(node) || isJSDocSignature(node)) {
|
|
77658
77880
|
const signature = getSignatureFromDeclaration(node);
|
|
77659
|
-
|
|
77660
|
-
signature,
|
|
77661
|
-
/*skipUnionExpanding*/
|
|
77662
|
-
true
|
|
77663
|
-
)[0];
|
|
77664
|
-
return enterNewScope(context, node, expandedParams, signature.typeParameters);
|
|
77881
|
+
return enterNewScope(context, node, signature.parameters, signature.typeParameters);
|
|
77665
77882
|
} else {
|
|
77666
77883
|
const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
|
|
77667
77884
|
return enterNewScope(
|
|
@@ -78405,7 +78622,7 @@ ${lanes.join("\n")}
|
|
|
78405
78622
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
78406
78623
|
var _a3;
|
|
78407
78624
|
const isStaticMethodSymbol = !!(symbol.flags & 8192) && // typeof static method
|
|
78408
|
-
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
78625
|
+
some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
|
|
78409
78626
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || // is exported function symbol
|
|
78410
78627
|
forEach(
|
|
78411
78628
|
symbol.declarations,
|
|
@@ -78734,6 +78951,44 @@ ${lanes.join("\n")}
|
|
|
78734
78951
|
ids.unshift(state);
|
|
78735
78952
|
return ids;
|
|
78736
78953
|
}
|
|
78954
|
+
function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
|
|
78955
|
+
if (indexInfo.components) {
|
|
78956
|
+
const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
|
|
78957
|
+
var _a22;
|
|
78958
|
+
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a22 = isEntityNameVisible(
|
|
78959
|
+
e.name.expression,
|
|
78960
|
+
context2.enclosingDeclaration,
|
|
78961
|
+
/*shouldComputeAliasToMakeVisible*/
|
|
78962
|
+
false
|
|
78963
|
+
)) == null ? void 0 : _a22.accessibility) === 0);
|
|
78964
|
+
});
|
|
78965
|
+
if (allComponentComputedNamesSerializable) {
|
|
78966
|
+
const newComponents = filter(indexInfo.components, (e) => {
|
|
78967
|
+
return !hasLateBindableName(e);
|
|
78968
|
+
});
|
|
78969
|
+
return map(newComponents, (e) => {
|
|
78970
|
+
trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
|
|
78971
|
+
return setTextRange2(
|
|
78972
|
+
context2,
|
|
78973
|
+
factory.createPropertySignature(
|
|
78974
|
+
indexInfo.isReadonly ? [factory.createModifier(
|
|
78975
|
+
148
|
|
78976
|
+
/* ReadonlyKeyword */
|
|
78977
|
+
)] : void 0,
|
|
78978
|
+
e.name,
|
|
78979
|
+
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
|
|
78980
|
+
58
|
|
78981
|
+
/* QuestionToken */
|
|
78982
|
+
) : void 0,
|
|
78983
|
+
typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
|
|
78984
|
+
),
|
|
78985
|
+
e
|
|
78986
|
+
);
|
|
78987
|
+
});
|
|
78988
|
+
}
|
|
78989
|
+
}
|
|
78990
|
+
return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
|
|
78991
|
+
}
|
|
78737
78992
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
78738
78993
|
if (checkTruncationLength(context)) {
|
|
78739
78994
|
if (context.flags & 1) {
|
|
@@ -78758,7 +79013,7 @@ ${lanes.join("\n")}
|
|
|
78758
79013
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180, context));
|
|
78759
79014
|
}
|
|
78760
79015
|
for (const info of resolvedType.indexInfos) {
|
|
78761
|
-
typeElements.push(
|
|
79016
|
+
typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context) : void 0));
|
|
78762
79017
|
}
|
|
78763
79018
|
const properties = resolvedType.properties;
|
|
78764
79019
|
if (!properties) {
|
|
@@ -79527,7 +79782,7 @@ ${lanes.join("\n")}
|
|
|
79527
79782
|
if (!context.tracker.canTrackSymbol) return;
|
|
79528
79783
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
79529
79784
|
const name = resolveName(
|
|
79530
|
-
|
|
79785
|
+
enclosingDeclaration,
|
|
79531
79786
|
firstIdentifier.escapedText,
|
|
79532
79787
|
111551 | 1048576,
|
|
79533
79788
|
/*nameNotFoundMessage*/
|
|
@@ -79542,6 +79797,24 @@ ${lanes.join("\n")}
|
|
|
79542
79797
|
111551
|
|
79543
79798
|
/* Value */
|
|
79544
79799
|
);
|
|
79800
|
+
} else {
|
|
79801
|
+
const fallback = resolveName(
|
|
79802
|
+
firstIdentifier,
|
|
79803
|
+
firstIdentifier.escapedText,
|
|
79804
|
+
111551 | 1048576,
|
|
79805
|
+
/*nameNotFoundMessage*/
|
|
79806
|
+
void 0,
|
|
79807
|
+
/*isUse*/
|
|
79808
|
+
true
|
|
79809
|
+
);
|
|
79810
|
+
if (fallback) {
|
|
79811
|
+
context.tracker.trackSymbol(
|
|
79812
|
+
fallback,
|
|
79813
|
+
enclosingDeclaration,
|
|
79814
|
+
111551
|
|
79815
|
+
/* Value */
|
|
79816
|
+
);
|
|
79817
|
+
}
|
|
79545
79818
|
}
|
|
79546
79819
|
}
|
|
79547
79820
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -86907,8 +87180,8 @@ ${lanes.join("\n")}
|
|
|
86907
87180
|
/* Index */
|
|
86908
87181
|
);
|
|
86909
87182
|
}
|
|
86910
|
-
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
86911
|
-
return { keyType, type, isReadonly, declaration };
|
|
87183
|
+
function createIndexInfo(keyType, type, isReadonly, declaration, components) {
|
|
87184
|
+
return { keyType, type, isReadonly, declaration, components };
|
|
86912
87185
|
}
|
|
86913
87186
|
function getIndexInfosOfSymbol(symbol) {
|
|
86914
87187
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -87446,6 +87719,9 @@ ${lanes.join("\n")}
|
|
|
87446
87719
|
case "Number":
|
|
87447
87720
|
checkNoTypeArguments(node);
|
|
87448
87721
|
return numberType;
|
|
87722
|
+
case "BigInt":
|
|
87723
|
+
checkNoTypeArguments(node);
|
|
87724
|
+
return bigintType;
|
|
87449
87725
|
case "Boolean":
|
|
87450
87726
|
checkNoTypeArguments(node);
|
|
87451
87727
|
return booleanType;
|
|
@@ -90117,7 +90393,7 @@ ${lanes.join("\n")}
|
|
|
90117
90393
|
return result;
|
|
90118
90394
|
}
|
|
90119
90395
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
90120
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
90396
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
|
|
90121
90397
|
}
|
|
90122
90398
|
function createLiteralType(flags, value2, symbol, regularType) {
|
|
90123
90399
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -90889,7 +91165,7 @@ ${lanes.join("\n")}
|
|
|
90889
91165
|
return type.restrictiveInstantiation;
|
|
90890
91166
|
}
|
|
90891
91167
|
function instantiateIndexInfo(info, mapper) {
|
|
90892
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
91168
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
|
|
90893
91169
|
}
|
|
90894
91170
|
function isContextSensitive(node) {
|
|
90895
91171
|
Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node));
|
|
@@ -95250,7 +95526,7 @@ ${lanes.join("\n")}
|
|
|
95250
95526
|
}
|
|
95251
95527
|
}
|
|
95252
95528
|
}
|
|
95253
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
95529
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
|
|
95254
95530
|
result.objectFlags |= getObjectFlags(type) & (4096 | 262144);
|
|
95255
95531
|
return result;
|
|
95256
95532
|
}
|
|
@@ -96786,6 +97062,7 @@ ${lanes.join("\n")}
|
|
|
96786
97062
|
return target.kind === 108;
|
|
96787
97063
|
case 235:
|
|
96788
97064
|
case 217:
|
|
97065
|
+
case 238:
|
|
96789
97066
|
return isMatchingReference(source.expression, target);
|
|
96790
97067
|
case 211:
|
|
96791
97068
|
case 212:
|
|
@@ -98826,6 +99103,7 @@ ${lanes.join("\n")}
|
|
|
98826
99103
|
if (checkDerived) {
|
|
98827
99104
|
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
98828
99105
|
}
|
|
99106
|
+
type = type.flags & 2 ? unknownUnionType : type;
|
|
98829
99107
|
const trueType2 = getNarrowedType(
|
|
98830
99108
|
type,
|
|
98831
99109
|
candidate,
|
|
@@ -98834,7 +99112,7 @@ ${lanes.join("\n")}
|
|
|
98834
99112
|
/*checkDerived*/
|
|
98835
99113
|
false
|
|
98836
99114
|
);
|
|
98837
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
99115
|
+
return recombineUnknownType(filterType(type, (t) => !isTypeSubsetOf(t, trueType2)));
|
|
98838
99116
|
}
|
|
98839
99117
|
if (type.flags & 3) {
|
|
98840
99118
|
return candidate;
|
|
@@ -98948,6 +99226,7 @@ ${lanes.join("\n")}
|
|
|
98948
99226
|
return narrowTypeByCallExpression(type, expr, assumeTrue);
|
|
98949
99227
|
case 217:
|
|
98950
99228
|
case 235:
|
|
99229
|
+
case 238:
|
|
98951
99230
|
return narrowType(type, expr.expression, assumeTrue);
|
|
98952
99231
|
case 226:
|
|
98953
99232
|
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
|
|
@@ -99371,8 +99650,9 @@ ${lanes.join("\n")}
|
|
|
99371
99650
|
}
|
|
99372
99651
|
if (isJsxOpeningFragment(node)) {
|
|
99373
99652
|
const file = getSourceFileOfNode(node);
|
|
99374
|
-
const
|
|
99375
|
-
if (
|
|
99653
|
+
const entity = getJsxFactoryEntity(file);
|
|
99654
|
+
if (entity) {
|
|
99655
|
+
const localJsxNamespace = getFirstIdentifier(entity).escapedText;
|
|
99376
99656
|
resolveName(
|
|
99377
99657
|
jsxFactoryLocation,
|
|
99378
99658
|
localJsxNamespace,
|
|
@@ -101732,12 +102012,22 @@ ${lanes.join("\n")}
|
|
|
101732
102012
|
/* ESSymbol */
|
|
101733
102013
|
);
|
|
101734
102014
|
}
|
|
102015
|
+
function isSymbolWithComputedName(symbol) {
|
|
102016
|
+
var _a2;
|
|
102017
|
+
const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
|
|
102018
|
+
return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
|
|
102019
|
+
}
|
|
101735
102020
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
102021
|
+
var _a2;
|
|
101736
102022
|
const propTypes = [];
|
|
102023
|
+
let components;
|
|
101737
102024
|
for (let i = offset; i < properties.length; i++) {
|
|
101738
102025
|
const prop = properties[i];
|
|
101739
102026
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
101740
102027
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
102028
|
+
if (isSymbolWithComputedName(properties[i])) {
|
|
102029
|
+
components = append(components, (_a2 = properties[i].declarations) == null ? void 0 : _a2[0]);
|
|
102030
|
+
}
|
|
101741
102031
|
}
|
|
101742
102032
|
}
|
|
101743
102033
|
const unionType = propTypes.length ? getUnionType(
|
|
@@ -101745,7 +102035,14 @@ ${lanes.join("\n")}
|
|
|
101745
102035
|
2
|
|
101746
102036
|
/* Subtype */
|
|
101747
102037
|
) : undefinedType;
|
|
101748
|
-
return createIndexInfo(
|
|
102038
|
+
return createIndexInfo(
|
|
102039
|
+
keyType,
|
|
102040
|
+
unionType,
|
|
102041
|
+
isReadonly,
|
|
102042
|
+
/*declaration*/
|
|
102043
|
+
void 0,
|
|
102044
|
+
components
|
|
102045
|
+
);
|
|
101749
102046
|
}
|
|
101750
102047
|
function getImmediateAliasedSymbol(symbol) {
|
|
101751
102048
|
Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
|
|
@@ -102332,6 +102629,9 @@ ${lanes.join("\n")}
|
|
|
102332
102629
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
|
|
102333
102630
|
}
|
|
102334
102631
|
function getJsxElementChildrenPropertyName(jsxNamespace) {
|
|
102632
|
+
if (compilerOptions.jsx === 4 || compilerOptions.jsx === 5) {
|
|
102633
|
+
return "children";
|
|
102634
|
+
}
|
|
102335
102635
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
|
|
102336
102636
|
}
|
|
102337
102637
|
function getUninstantiatedJsxSignaturesOfType(elementType, caller) {
|
|
@@ -104010,8 +104310,8 @@ ${lanes.join("\n")}
|
|
|
104010
104310
|
}
|
|
104011
104311
|
}
|
|
104012
104312
|
function getEffectiveCheckNode(argument) {
|
|
104013
|
-
|
|
104014
|
-
return
|
|
104313
|
+
const flags = isInJSFile(argument) ? 1 | 32 | -2147483648 : 1 | 32;
|
|
104314
|
+
return skipOuterExpressions(argument, flags);
|
|
104015
104315
|
}
|
|
104016
104316
|
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
|
|
104017
104317
|
const errorOutputContainer = { errors: void 0, skipLogging: true };
|
|
@@ -104436,11 +104736,16 @@ ${lanes.join("\n")}
|
|
|
104436
104736
|
if (!result) {
|
|
104437
104737
|
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
104438
104738
|
}
|
|
104739
|
+
const links = getNodeLinks(node);
|
|
104740
|
+
if (links.resolvedSignature !== resolvingSignature && !candidatesOutArray) {
|
|
104741
|
+
Debug.assert(links.resolvedSignature);
|
|
104742
|
+
return links.resolvedSignature;
|
|
104743
|
+
}
|
|
104439
104744
|
if (result) {
|
|
104440
104745
|
return result;
|
|
104441
104746
|
}
|
|
104442
104747
|
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
104443
|
-
|
|
104748
|
+
links.resolvedSignature = result;
|
|
104444
104749
|
if (reportErrors2) {
|
|
104445
104750
|
if (!headMessage && isInstanceof) {
|
|
104446
104751
|
headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method;
|
|
@@ -105456,7 +105761,7 @@ ${lanes.join("\n")}
|
|
|
105456
105761
|
resolutionStart = resolutionTargets.length;
|
|
105457
105762
|
}
|
|
105458
105763
|
links.resolvedSignature = resolvingSignature;
|
|
105459
|
-
|
|
105764
|
+
const result = resolveSignature(
|
|
105460
105765
|
node,
|
|
105461
105766
|
candidatesOutArray,
|
|
105462
105767
|
checkMode || 0
|
|
@@ -105464,9 +105769,6 @@ ${lanes.join("\n")}
|
|
|
105464
105769
|
);
|
|
105465
105770
|
resolutionStart = saveResolutionStart;
|
|
105466
105771
|
if (result !== resolvingSignature) {
|
|
105467
|
-
if (links.resolvedSignature !== resolvingSignature) {
|
|
105468
|
-
result = links.resolvedSignature;
|
|
105469
|
-
}
|
|
105470
105772
|
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
|
|
105471
105773
|
}
|
|
105472
105774
|
return result;
|
|
@@ -106073,12 +106375,12 @@ ${lanes.join("\n")}
|
|
|
106073
106375
|
}
|
|
106074
106376
|
}
|
|
106075
106377
|
function checkImportMetaProperty(node) {
|
|
106076
|
-
if (
|
|
106378
|
+
if (100 <= moduleKind && moduleKind <= 199) {
|
|
106077
106379
|
if (getSourceFileOfNode(node).impliedNodeFormat !== 99) {
|
|
106078
106380
|
error2(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
106079
106381
|
}
|
|
106080
106382
|
} else if (moduleKind < 6 && moduleKind !== 4) {
|
|
106081
|
-
error2(node, Diagnostics.
|
|
106383
|
+
error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext);
|
|
106082
106384
|
}
|
|
106083
106385
|
const file = getSourceFileOfNode(node);
|
|
106084
106386
|
Debug.assert(!!(file.flags & 8388608), "Containing file is missing import meta node flag.");
|
|
@@ -106953,7 +107255,7 @@ ${lanes.join("\n")}
|
|
|
106953
107255
|
}
|
|
106954
107256
|
return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
|
|
106955
107257
|
}
|
|
106956
|
-
const type = checkExpressionCached(node.expression);
|
|
107258
|
+
const type = getBaseConstraintOrType(checkExpressionCached(node.expression));
|
|
106957
107259
|
if (!isLiteralType(type)) {
|
|
106958
107260
|
return false;
|
|
106959
107261
|
}
|
|
@@ -107229,19 +107531,7 @@ ${lanes.join("\n")}
|
|
|
107229
107531
|
const exprType = checkExpression(node.body);
|
|
107230
107532
|
const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
|
|
107231
107533
|
if (returnOrPromisedType) {
|
|
107232
|
-
|
|
107233
|
-
if ((functionFlags & 3) === 2) {
|
|
107234
|
-
const awaitedType = checkAwaitedType(
|
|
107235
|
-
exprType,
|
|
107236
|
-
/*withAlias*/
|
|
107237
|
-
false,
|
|
107238
|
-
effectiveCheckNode,
|
|
107239
|
-
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
107240
|
-
);
|
|
107241
|
-
checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
|
|
107242
|
-
} else {
|
|
107243
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
|
|
107244
|
-
}
|
|
107534
|
+
checkReturnExpression(node, returnOrPromisedType, node.body, node.body, exprType);
|
|
107245
107535
|
}
|
|
107246
107536
|
}
|
|
107247
107537
|
}
|
|
@@ -107295,7 +107585,7 @@ ${lanes.join("\n")}
|
|
|
107295
107585
|
}
|
|
107296
107586
|
if (isReadonlySymbol(symbol)) {
|
|
107297
107587
|
if (symbol.flags & 4 && isAccessExpression(expr) && expr.expression.kind === 110) {
|
|
107298
|
-
const ctor =
|
|
107588
|
+
const ctor = getControlFlowContainer(expr);
|
|
107299
107589
|
if (!(ctor && (ctor.kind === 176 || isJSConstructor(ctor)))) {
|
|
107300
107590
|
return true;
|
|
107301
107591
|
}
|
|
@@ -107326,7 +107616,7 @@ ${lanes.join("\n")}
|
|
|
107326
107616
|
function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) {
|
|
107327
107617
|
const node = skipOuterExpressions(
|
|
107328
107618
|
expr,
|
|
107329
|
-
|
|
107619
|
+
38 | 1
|
|
107330
107620
|
/* Parentheses */
|
|
107331
107621
|
);
|
|
107332
107622
|
if (node.kind !== 80 && !isAccessExpression(node)) {
|
|
@@ -107399,6 +107689,7 @@ ${lanes.join("\n")}
|
|
|
107399
107689
|
}
|
|
107400
107690
|
switch (moduleKind) {
|
|
107401
107691
|
case 100:
|
|
107692
|
+
case 101:
|
|
107402
107693
|
case 199:
|
|
107403
107694
|
if (sourceFile.impliedNodeFormat === 1) {
|
|
107404
107695
|
span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
@@ -107419,7 +107710,7 @@ ${lanes.join("\n")}
|
|
|
107419
107710
|
// fallthrough
|
|
107420
107711
|
default:
|
|
107421
107712
|
span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
107422
|
-
const message2 = isAwaitExpression(node) ? Diagnostics.
|
|
107713
|
+
const message2 = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
|
|
107423
107714
|
diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message2));
|
|
107424
107715
|
hasError = true;
|
|
107425
107716
|
break;
|
|
@@ -108059,7 +108350,7 @@ ${lanes.join("\n")}
|
|
|
108059
108350
|
}
|
|
108060
108351
|
const leftTarget = skipOuterExpressions(
|
|
108061
108352
|
left2,
|
|
108062
|
-
|
|
108353
|
+
63
|
|
108063
108354
|
/* All */
|
|
108064
108355
|
);
|
|
108065
108356
|
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
|
@@ -109460,6 +109751,9 @@ ${lanes.join("\n")}
|
|
|
109460
109751
|
31
|
|
109461
109752
|
/* ParameterPropertyModifier */
|
|
109462
109753
|
)) {
|
|
109754
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
|
109755
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
109756
|
+
}
|
|
109463
109757
|
if (!(func.kind === 176 && nodeIsPresent(func.body))) {
|
|
109464
109758
|
error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
109465
109759
|
}
|
|
@@ -112959,7 +113253,6 @@ ${lanes.join("\n")}
|
|
|
112959
113253
|
}
|
|
112960
113254
|
const signature = getSignatureFromDeclaration(container);
|
|
112961
113255
|
const returnType = getReturnTypeOfSignature(signature);
|
|
112962
|
-
const functionFlags = getFunctionFlags(container);
|
|
112963
113256
|
if (strictNullChecks || node.expression || returnType.flags & 131072) {
|
|
112964
113257
|
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
|
|
112965
113258
|
if (container.kind === 178) {
|
|
@@ -112967,26 +113260,57 @@ ${lanes.join("\n")}
|
|
|
112967
113260
|
error2(node, Diagnostics.Setters_cannot_return_a_value);
|
|
112968
113261
|
}
|
|
112969
113262
|
} else if (container.kind === 176) {
|
|
112970
|
-
|
|
113263
|
+
const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType;
|
|
113264
|
+
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) {
|
|
112971
113265
|
error2(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
|
|
112972
113266
|
}
|
|
112973
113267
|
} else if (getReturnTypeFromAnnotation(container)) {
|
|
112974
|
-
const unwrappedReturnType = unwrapReturnType(returnType,
|
|
112975
|
-
|
|
112976
|
-
exprType,
|
|
112977
|
-
/*withAlias*/
|
|
112978
|
-
false,
|
|
112979
|
-
node,
|
|
112980
|
-
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
112981
|
-
) : exprType;
|
|
112982
|
-
if (unwrappedReturnType) {
|
|
112983
|
-
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
|
|
112984
|
-
}
|
|
113268
|
+
const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(container)) ?? returnType;
|
|
113269
|
+
checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType);
|
|
112985
113270
|
}
|
|
112986
113271
|
} else if (container.kind !== 176 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) {
|
|
112987
113272
|
error2(node, Diagnostics.Not_all_code_paths_return_a_value);
|
|
112988
113273
|
}
|
|
112989
113274
|
}
|
|
113275
|
+
function checkReturnExpression(container, unwrappedReturnType, node, expr, exprType, inConditionalExpression = false) {
|
|
113276
|
+
const excludeJSDocTypeAssertions = isInJSFile(node);
|
|
113277
|
+
const functionFlags = getFunctionFlags(container);
|
|
113278
|
+
if (expr) {
|
|
113279
|
+
const unwrappedExpr = skipParentheses(expr, excludeJSDocTypeAssertions);
|
|
113280
|
+
if (isConditionalExpression(unwrappedExpr)) {
|
|
113281
|
+
checkReturnExpression(
|
|
113282
|
+
container,
|
|
113283
|
+
unwrappedReturnType,
|
|
113284
|
+
node,
|
|
113285
|
+
unwrappedExpr.whenTrue,
|
|
113286
|
+
checkExpression(unwrappedExpr.whenTrue),
|
|
113287
|
+
/*inConditionalExpression*/
|
|
113288
|
+
true
|
|
113289
|
+
);
|
|
113290
|
+
checkReturnExpression(
|
|
113291
|
+
container,
|
|
113292
|
+
unwrappedReturnType,
|
|
113293
|
+
node,
|
|
113294
|
+
unwrappedExpr.whenFalse,
|
|
113295
|
+
checkExpression(unwrappedExpr.whenFalse),
|
|
113296
|
+
/*inConditionalExpression*/
|
|
113297
|
+
true
|
|
113298
|
+
);
|
|
113299
|
+
return;
|
|
113300
|
+
}
|
|
113301
|
+
}
|
|
113302
|
+
const inReturnStatement = node.kind === 253;
|
|
113303
|
+
const unwrappedExprType = functionFlags & 2 ? checkAwaitedType(
|
|
113304
|
+
exprType,
|
|
113305
|
+
/*withAlias*/
|
|
113306
|
+
false,
|
|
113307
|
+
node,
|
|
113308
|
+
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
113309
|
+
) : exprType;
|
|
113310
|
+
const effectiveExpr = expr && getEffectiveCheckNode(expr);
|
|
113311
|
+
const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr;
|
|
113312
|
+
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
|
113313
|
+
}
|
|
112990
113314
|
function checkWithStatement(node) {
|
|
112991
113315
|
if (!checkGrammarStatementInAmbientContext(node)) {
|
|
112992
113316
|
if (node.flags & 65536) {
|
|
@@ -113118,7 +113442,7 @@ ${lanes.join("\n")}
|
|
|
113118
113442
|
const typeDeclaration = symbol.valueDeclaration;
|
|
113119
113443
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
113120
113444
|
for (const member of typeDeclaration.members) {
|
|
113121
|
-
if (!isStatic(member) && !hasBindableName(member)) {
|
|
113445
|
+
if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
|
|
113122
113446
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
113123
113447
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
113124
113448
|
}
|
|
@@ -113604,6 +113928,13 @@ ${lanes.join("\n")}
|
|
|
113604
113928
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
|
|
113605
113929
|
const isJs = isInJSFile(node);
|
|
113606
113930
|
const nodeInAmbientContext = !!(node.flags & 33554432);
|
|
113931
|
+
if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) {
|
|
113932
|
+
error2(
|
|
113933
|
+
errorNode,
|
|
113934
|
+
isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
|
|
113935
|
+
);
|
|
113936
|
+
return 2;
|
|
113937
|
+
}
|
|
113607
113938
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
113608
113939
|
const thisType = memberIsStatic ? staticType : typeWithThis;
|
|
113609
113940
|
const baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
@@ -114220,6 +114551,9 @@ ${lanes.join("\n")}
|
|
|
114220
114551
|
checkCollisionsForDeclarationName(node, node.name);
|
|
114221
114552
|
checkExportsOnMergedDeclarations(node);
|
|
114222
114553
|
node.members.forEach(checkEnumMember);
|
|
114554
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
|
|
114555
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
114556
|
+
}
|
|
114223
114557
|
computeEnumMemberValues(node);
|
|
114224
114558
|
const enumSymbol = getSymbolOfDeclaration(node);
|
|
114225
114559
|
const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);
|
|
@@ -114321,6 +114655,9 @@ ${lanes.join("\n")}
|
|
|
114321
114655
|
checkExportsOnMergedDeclarations(node);
|
|
114322
114656
|
const symbol = getSymbolOfDeclaration(node);
|
|
114323
114657
|
if (symbol.flags & 512 && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) {
|
|
114658
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
|
114659
|
+
error2(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
114660
|
+
}
|
|
114324
114661
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
|
114325
114662
|
error2(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
|
|
114326
114663
|
}
|
|
@@ -114659,10 +114996,20 @@ ${lanes.join("\n")}
|
|
|
114659
114996
|
if (validForTypeAttributes && override) {
|
|
114660
114997
|
return;
|
|
114661
114998
|
}
|
|
114662
|
-
|
|
114663
|
-
|
|
114664
|
-
|
|
114665
|
-
|
|
114999
|
+
if (!moduleSupportsImportAttributes(moduleKind)) {
|
|
115000
|
+
return grammarErrorOnNode(
|
|
115001
|
+
node,
|
|
115002
|
+
isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
|
|
115003
|
+
);
|
|
115004
|
+
}
|
|
115005
|
+
if (moduleKind === 199 && !isImportAttributes2) {
|
|
115006
|
+
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
|
115007
|
+
}
|
|
115008
|
+
if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1) {
|
|
115009
|
+
return grammarErrorOnNode(
|
|
115010
|
+
node,
|
|
115011
|
+
isImportAttributes2 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls
|
|
115012
|
+
);
|
|
114666
115013
|
}
|
|
114667
115014
|
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a2 = declaration.importClause) == null ? void 0 : _a2.isTypeOnly : declaration.isTypeOnly);
|
|
114668
115015
|
if (isTypeOnly) {
|
|
@@ -114707,7 +115054,7 @@ ${lanes.join("\n")}
|
|
|
114707
115054
|
}
|
|
114708
115055
|
}
|
|
114709
115056
|
}
|
|
114710
|
-
if (!importClause.isTypeOnly && moduleKind
|
|
115057
|
+
if (!importClause.isTypeOnly && 101 <= moduleKind && moduleKind <= 199 && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
|
114711
115058
|
error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
|
|
114712
115059
|
}
|
|
114713
115060
|
} else if (noUncheckedSideEffectImports && !importClause) {
|
|
@@ -114727,6 +115074,9 @@ ${lanes.join("\n")}
|
|
|
114727
115074
|
return;
|
|
114728
115075
|
}
|
|
114729
115076
|
checkGrammarModifiers(node);
|
|
115077
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
|
|
115078
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
115079
|
+
}
|
|
114730
115080
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
114731
115081
|
checkImportBinding(node);
|
|
114732
115082
|
markLinkedReferences(
|
|
@@ -114871,6 +115221,9 @@ ${lanes.join("\n")}
|
|
|
114871
115221
|
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
|
|
114872
115222
|
return;
|
|
114873
115223
|
}
|
|
115224
|
+
if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432)) {
|
|
115225
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
115226
|
+
}
|
|
114874
115227
|
const container = node.parent.kind === 307 ? node.parent : node.parent.parent;
|
|
114875
115228
|
if (container.kind === 267 && !isAmbientModule(container)) {
|
|
114876
115229
|
if (node.isExportEquals) {
|
|
@@ -115914,7 +116267,7 @@ ${lanes.join("\n")}
|
|
|
115914
116267
|
name,
|
|
115915
116268
|
meaning,
|
|
115916
116269
|
/*ignoreErrors*/
|
|
115917
|
-
|
|
116270
|
+
true,
|
|
115918
116271
|
/*dontResolveAlias*/
|
|
115919
116272
|
true
|
|
115920
116273
|
);
|
|
@@ -115924,8 +116277,9 @@ ${lanes.join("\n")}
|
|
|
115924
116277
|
return resolveEntityName(
|
|
115925
116278
|
name,
|
|
115926
116279
|
/*meaning*/
|
|
115927
|
-
1
|
|
115928
|
-
/*
|
|
116280
|
+
1,
|
|
116281
|
+
/*ignoreErrors*/
|
|
116282
|
+
true
|
|
115929
116283
|
);
|
|
115930
116284
|
}
|
|
115931
116285
|
return void 0;
|
|
@@ -116116,8 +116470,9 @@ ${lanes.join("\n")}
|
|
|
116116
116470
|
if (location && location.kind === 304) {
|
|
116117
116471
|
return resolveEntityName(
|
|
116118
116472
|
location.name,
|
|
116119
|
-
111551 | 2097152
|
|
116120
|
-
/*
|
|
116473
|
+
111551 | 2097152,
|
|
116474
|
+
/*ignoreErrors*/
|
|
116475
|
+
true
|
|
116121
116476
|
);
|
|
116122
116477
|
}
|
|
116123
116478
|
return void 0;
|
|
@@ -116129,15 +116484,17 @@ ${lanes.join("\n")}
|
|
|
116129
116484
|
// Skip for invalid syntax like this: export { "x" }
|
|
116130
116485
|
resolveEntityName(
|
|
116131
116486
|
name,
|
|
116132
|
-
111551 | 788968 | 1920 | 2097152
|
|
116133
|
-
/*
|
|
116487
|
+
111551 | 788968 | 1920 | 2097152,
|
|
116488
|
+
/*ignoreErrors*/
|
|
116489
|
+
true
|
|
116134
116490
|
)
|
|
116135
116491
|
);
|
|
116136
116492
|
} else {
|
|
116137
116493
|
return resolveEntityName(
|
|
116138
116494
|
node,
|
|
116139
|
-
111551 | 788968 | 1920 | 2097152
|
|
116140
|
-
/*
|
|
116495
|
+
111551 | 788968 | 1920 | 2097152,
|
|
116496
|
+
/*ignoreErrors*/
|
|
116497
|
+
true
|
|
116141
116498
|
);
|
|
116142
116499
|
}
|
|
116143
116500
|
}
|
|
@@ -117174,6 +117531,44 @@ ${lanes.join("\n")}
|
|
|
117174
117531
|
for (const info of infoList) {
|
|
117175
117532
|
if (info.declaration) continue;
|
|
117176
117533
|
if (info === anyBaseTypeIndexInfo) continue;
|
|
117534
|
+
if (info.components) {
|
|
117535
|
+
const allComponentComputedNamesSerializable = every(info.components, (e) => {
|
|
117536
|
+
var _a2;
|
|
117537
|
+
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a2 = isEntityNameVisible(
|
|
117538
|
+
e.name.expression,
|
|
117539
|
+
enclosing,
|
|
117540
|
+
/*shouldComputeAliasToMakeVisible*/
|
|
117541
|
+
false
|
|
117542
|
+
)) == null ? void 0 : _a2.accessibility) === 0);
|
|
117543
|
+
});
|
|
117544
|
+
if (allComponentComputedNamesSerializable) {
|
|
117545
|
+
const newComponents = filter(info.components, (e) => {
|
|
117546
|
+
return !hasLateBindableName(e);
|
|
117547
|
+
});
|
|
117548
|
+
result.push(...map(newComponents, (e) => {
|
|
117549
|
+
trackComputedName(e.name.expression);
|
|
117550
|
+
const mods = infoList === staticInfos ? [factory.createModifier(
|
|
117551
|
+
126
|
|
117552
|
+
/* StaticKeyword */
|
|
117553
|
+
)] : void 0;
|
|
117554
|
+
return factory.createPropertyDeclaration(
|
|
117555
|
+
append(mods, info.isReadonly ? factory.createModifier(
|
|
117556
|
+
148
|
|
117557
|
+
/* ReadonlyKeyword */
|
|
117558
|
+
) : void 0),
|
|
117559
|
+
e.name,
|
|
117560
|
+
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
|
|
117561
|
+
58
|
|
117562
|
+
/* QuestionToken */
|
|
117563
|
+
) : void 0,
|
|
117564
|
+
nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker),
|
|
117565
|
+
/*initializer*/
|
|
117566
|
+
void 0
|
|
117567
|
+
);
|
|
117568
|
+
}));
|
|
117569
|
+
continue;
|
|
117570
|
+
}
|
|
117571
|
+
}
|
|
117177
117572
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
117178
117573
|
if (node && infoList === staticInfos) {
|
|
117179
117574
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(
|
|
@@ -117187,6 +117582,27 @@ ${lanes.join("\n")}
|
|
|
117187
117582
|
}
|
|
117188
117583
|
}
|
|
117189
117584
|
return result;
|
|
117585
|
+
function trackComputedName(accessExpression) {
|
|
117586
|
+
if (!tracker.trackSymbol) return;
|
|
117587
|
+
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
117588
|
+
const name = resolveName(
|
|
117589
|
+
firstIdentifier,
|
|
117590
|
+
firstIdentifier.escapedText,
|
|
117591
|
+
111551 | 1048576,
|
|
117592
|
+
/*nameNotFoundMessage*/
|
|
117593
|
+
void 0,
|
|
117594
|
+
/*isUse*/
|
|
117595
|
+
true
|
|
117596
|
+
);
|
|
117597
|
+
if (name) {
|
|
117598
|
+
tracker.trackSymbol(
|
|
117599
|
+
name,
|
|
117600
|
+
enclosing,
|
|
117601
|
+
111551
|
|
117602
|
+
/* Value */
|
|
117603
|
+
);
|
|
117604
|
+
}
|
|
117605
|
+
}
|
|
117190
117606
|
}
|
|
117191
117607
|
};
|
|
117192
117608
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -118311,6 +118727,7 @@ ${lanes.join("\n")}
|
|
|
118311
118727
|
}
|
|
118312
118728
|
switch (moduleKind) {
|
|
118313
118729
|
case 100:
|
|
118730
|
+
case 101:
|
|
118314
118731
|
case 199:
|
|
118315
118732
|
if (sourceFile.impliedNodeFormat === 1) {
|
|
118316
118733
|
diagnostics.add(
|
|
@@ -118329,7 +118746,7 @@ ${lanes.join("\n")}
|
|
|
118329
118746
|
// fallthrough
|
|
118330
118747
|
default:
|
|
118331
118748
|
diagnostics.add(
|
|
118332
|
-
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.
|
|
118749
|
+
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
|
|
118333
118750
|
);
|
|
118334
118751
|
break;
|
|
118335
118752
|
}
|
|
@@ -118491,7 +118908,7 @@ ${lanes.join("\n")}
|
|
|
118491
118908
|
}
|
|
118492
118909
|
}
|
|
118493
118910
|
function checkGrammarForInvalidDynamicName(node, message2) {
|
|
118494
|
-
if (isNonBindableDynamicName(node)) {
|
|
118911
|
+
if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
|
|
118495
118912
|
return grammarErrorOnNode(node, message2);
|
|
118496
118913
|
}
|
|
118497
118914
|
}
|
|
@@ -118958,17 +119375,17 @@ ${lanes.join("\n")}
|
|
|
118958
119375
|
return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
118959
119376
|
}
|
|
118960
119377
|
if (moduleKind === 5) {
|
|
118961
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
119378
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext);
|
|
118962
119379
|
}
|
|
118963
119380
|
if (node.typeArguments) {
|
|
118964
119381
|
return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
118965
119382
|
}
|
|
118966
119383
|
const nodeArguments = node.arguments;
|
|
118967
|
-
if (
|
|
119384
|
+
if (!(100 <= moduleKind && moduleKind <= 199) && moduleKind !== 99 && moduleKind !== 200) {
|
|
118968
119385
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
118969
119386
|
if (nodeArguments.length > 1) {
|
|
118970
119387
|
const importAttributesArgument = nodeArguments[1];
|
|
118971
|
-
return grammarErrorOnNode(importAttributesArgument, Diagnostics.
|
|
119388
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve);
|
|
118972
119389
|
}
|
|
118973
119390
|
}
|
|
118974
119391
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -123992,7 +124409,7 @@ ${lanes.join("\n")}
|
|
|
123992
124409
|
return updated;
|
|
123993
124410
|
}
|
|
123994
124411
|
function visitParenthesizedExpression(node) {
|
|
123995
|
-
const innerExpression = skipOuterExpressions(node.expression, ~(
|
|
124412
|
+
const innerExpression = skipOuterExpressions(node.expression, ~(38 | 16));
|
|
123996
124413
|
if (isAssertionExpression(innerExpression) || isSatisfiesExpression(innerExpression)) {
|
|
123997
124414
|
const expression = visitNode(node.expression, visitor, isExpression);
|
|
123998
124415
|
Debug.assert(expression);
|
|
@@ -143681,7 +144098,7 @@ ${lanes.join("\n")}
|
|
|
143681
144098
|
if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) {
|
|
143682
144099
|
return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift());
|
|
143683
144100
|
}
|
|
143684
|
-
|
|
144101
|
+
// fallthrough
|
|
143685
144102
|
default:
|
|
143686
144103
|
if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
|
|
143687
144104
|
return visitEachChild(node, visitor, context);
|
|
@@ -144533,11 +144950,7 @@ ${lanes.join("\n")}
|
|
|
144533
144950
|
if (isSetAccessor(node.parent)) {
|
|
144534
144951
|
return createAccessorTypeError(node.parent);
|
|
144535
144952
|
}
|
|
144536
|
-
const addUndefined = resolver.requiresAddingImplicitUndefined(
|
|
144537
|
-
node,
|
|
144538
|
-
/*enclosingDeclaration*/
|
|
144539
|
-
void 0
|
|
144540
|
-
);
|
|
144953
|
+
const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent);
|
|
144541
144954
|
if (!addUndefined && node.initializer) {
|
|
144542
144955
|
return createExpressionError(node.initializer);
|
|
144543
144956
|
}
|
|
@@ -146334,6 +146747,7 @@ ${lanes.join("\n")}
|
|
|
146334
146747
|
case 6:
|
|
146335
146748
|
case 5:
|
|
146336
146749
|
case 100:
|
|
146750
|
+
case 101:
|
|
146337
146751
|
case 199:
|
|
146338
146752
|
case 1:
|
|
146339
146753
|
return transformImpliedNodeFormatDependentModule;
|
|
@@ -153197,45 +153611,6 @@ ${lanes.join("\n")}
|
|
|
153197
153611
|
}
|
|
153198
153612
|
return resolutions;
|
|
153199
153613
|
}
|
|
153200
|
-
function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
153201
|
-
return forEachProjectReference(
|
|
153202
|
-
/*projectReferences*/
|
|
153203
|
-
void 0,
|
|
153204
|
-
resolvedProjectReferences,
|
|
153205
|
-
(resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
|
|
153206
|
-
);
|
|
153207
|
-
}
|
|
153208
|
-
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
|
153209
|
-
let seenResolvedRefs;
|
|
153210
|
-
return worker(
|
|
153211
|
-
projectReferences,
|
|
153212
|
-
resolvedProjectReferences,
|
|
153213
|
-
/*parent*/
|
|
153214
|
-
void 0
|
|
153215
|
-
);
|
|
153216
|
-
function worker(projectReferences2, resolvedProjectReferences2, parent2) {
|
|
153217
|
-
if (cbRef) {
|
|
153218
|
-
const result = cbRef(projectReferences2, parent2);
|
|
153219
|
-
if (result) return result;
|
|
153220
|
-
}
|
|
153221
|
-
let skipChildren;
|
|
153222
|
-
return forEach(
|
|
153223
|
-
resolvedProjectReferences2,
|
|
153224
|
-
(resolvedRef, index) => {
|
|
153225
|
-
if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
|
|
153226
|
-
(skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
|
|
153227
|
-
return void 0;
|
|
153228
|
-
}
|
|
153229
|
-
const result = cbResolvedRef(resolvedRef, parent2, index);
|
|
153230
|
-
if (result || !resolvedRef) return result;
|
|
153231
|
-
(seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
|
|
153232
|
-
}
|
|
153233
|
-
) || forEach(
|
|
153234
|
-
resolvedProjectReferences2,
|
|
153235
|
-
(resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
|
|
153236
|
-
);
|
|
153237
|
-
}
|
|
153238
|
-
}
|
|
153239
153614
|
var inferredTypesContainingFile = "__inferred type names__.ts";
|
|
153240
153615
|
function getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName) {
|
|
153241
153616
|
const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory;
|
|
@@ -153251,13 +153626,6 @@ ${lanes.join("\n")}
|
|
|
153251
153626
|
}
|
|
153252
153627
|
return "@typescript/lib-" + path14;
|
|
153253
153628
|
}
|
|
153254
|
-
function getLibNameFromLibReference(libReference) {
|
|
153255
|
-
return toFileNameLowerCase(libReference.fileName);
|
|
153256
|
-
}
|
|
153257
|
-
function getLibFileNameFromLibReference(libReference) {
|
|
153258
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
153259
|
-
return libMap.get(libName);
|
|
153260
|
-
}
|
|
153261
153629
|
function isReferencedFile(reason) {
|
|
153262
153630
|
switch (reason == null ? void 0 : reason.kind) {
|
|
153263
153631
|
case 3:
|
|
@@ -153492,11 +153860,13 @@ ${lanes.join("\n")}
|
|
|
153492
153860
|
typeScriptVersion: typeScriptVersion3
|
|
153493
153861
|
};
|
|
153494
153862
|
}
|
|
153495
|
-
function createProgram(
|
|
153863
|
+
function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
153496
153864
|
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
153497
|
-
|
|
153498
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } =
|
|
153499
|
-
let { oldProgram } =
|
|
153865
|
+
let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions;
|
|
153866
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3, host: createProgramOptionsHost } = _createProgramOptions;
|
|
153867
|
+
let { oldProgram } = _createProgramOptions;
|
|
153868
|
+
_createProgramOptions = void 0;
|
|
153869
|
+
_rootNamesOrOptions = void 0;
|
|
153500
153870
|
for (const option of commandLineOptionOfCustomType) {
|
|
153501
153871
|
if (hasProperty(options, option.name)) {
|
|
153502
153872
|
if (typeof options[option.name] === "string") {
|
|
@@ -153509,16 +153879,12 @@ ${lanes.join("\n")}
|
|
|
153509
153879
|
let processingOtherFiles;
|
|
153510
153880
|
let files;
|
|
153511
153881
|
let symlinks;
|
|
153512
|
-
let commonSourceDirectory;
|
|
153513
153882
|
let typeChecker;
|
|
153514
153883
|
let classifiableNames;
|
|
153515
|
-
let fileReasons = createMultiMap();
|
|
153516
153884
|
let filesWithReferencesProcessed;
|
|
153517
|
-
let fileReasonsToChain;
|
|
153518
|
-
let reasonToRelatedInfo;
|
|
153519
153885
|
let cachedBindAndCheckDiagnosticsForFile;
|
|
153520
153886
|
let cachedDeclarationDiagnosticsForFile;
|
|
153521
|
-
|
|
153887
|
+
const programDiagnostics = createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax);
|
|
153522
153888
|
let automaticTypeDirectiveNames;
|
|
153523
153889
|
let automaticTypeDirectiveResolutions;
|
|
153524
153890
|
let resolvedLibReferences;
|
|
@@ -153540,13 +153906,12 @@ ${lanes.join("\n")}
|
|
|
153540
153906
|
true
|
|
153541
153907
|
);
|
|
153542
153908
|
mark("beforeProgram");
|
|
153543
|
-
const host =
|
|
153909
|
+
const host = createProgramOptionsHost || createCompilerHost(options);
|
|
153544
153910
|
const configParsingHost = parseConfigHostFromCompilerHostLike(host);
|
|
153545
153911
|
let skipDefaultLib = options.noLib;
|
|
153546
153912
|
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
|
153547
153913
|
const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
|
|
153548
|
-
|
|
153549
|
-
let lazyProgramDiagnosticExplainingFile = [];
|
|
153914
|
+
let skipVerifyCompilerOptions = false;
|
|
153550
153915
|
const currentDirectory = host.getCurrentDirectory();
|
|
153551
153916
|
const supportedExtensions = getSupportedExtensions(options);
|
|
153552
153917
|
const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
@@ -153831,7 +154196,7 @@ ${lanes.join("\n")}
|
|
|
153831
154196
|
getTypeCount: () => getTypeChecker().getTypeCount(),
|
|
153832
154197
|
getInstantiationCount: () => getTypeChecker().getInstantiationCount(),
|
|
153833
154198
|
getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(),
|
|
153834
|
-
getFileProcessingDiagnostics: () =>
|
|
154199
|
+
getFileProcessingDiagnostics: () => programDiagnostics.getFileProcessingDiagnostics(),
|
|
153835
154200
|
getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames,
|
|
153836
154201
|
getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions,
|
|
153837
154202
|
isSourceFileFromExternalLibrary,
|
|
@@ -153847,6 +154212,7 @@ ${lanes.join("\n")}
|
|
|
153847
154212
|
resolvedModules,
|
|
153848
154213
|
resolvedTypeReferenceDirectiveNames,
|
|
153849
154214
|
resolvedLibReferences,
|
|
154215
|
+
getProgramDiagnosticsContainer: () => programDiagnostics,
|
|
153850
154216
|
getResolvedModule,
|
|
153851
154217
|
getResolvedModuleFromModuleSpecifier,
|
|
153852
154218
|
getResolvedTypeReferenceDirective,
|
|
@@ -153879,70 +154245,19 @@ ${lanes.join("\n")}
|
|
|
153879
154245
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
153880
154246
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
153881
154247
|
getCanonicalFileName,
|
|
153882
|
-
getFileIncludeReasons: () =>
|
|
154248
|
+
getFileIncludeReasons: () => programDiagnostics.getFileReasons(),
|
|
153883
154249
|
structureIsReused,
|
|
153884
154250
|
writeFile: writeFile22,
|
|
153885
154251
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
|
|
153886
154252
|
};
|
|
153887
154253
|
onProgramCreateComplete();
|
|
153888
|
-
|
|
154254
|
+
if (!skipVerifyCompilerOptions) {
|
|
154255
|
+
verifyCompilerOptions();
|
|
154256
|
+
}
|
|
153889
154257
|
mark("afterProgram");
|
|
153890
154258
|
measure("Program", "beforeProgram", "afterProgram");
|
|
153891
154259
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
153892
154260
|
return program;
|
|
153893
|
-
function updateAndGetProgramDiagnostics() {
|
|
153894
|
-
if (lazyProgramDiagnosticExplainingFile) {
|
|
153895
|
-
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
153896
|
-
switch (diagnostic.kind) {
|
|
153897
|
-
case 1:
|
|
153898
|
-
return programDiagnostics.add(
|
|
153899
|
-
createDiagnosticExplainingFile(
|
|
153900
|
-
diagnostic.file && getSourceFileByPath(diagnostic.file),
|
|
153901
|
-
diagnostic.fileProcessingReason,
|
|
153902
|
-
diagnostic.diagnostic,
|
|
153903
|
-
diagnostic.args || emptyArray
|
|
153904
|
-
)
|
|
153905
|
-
);
|
|
153906
|
-
case 0:
|
|
153907
|
-
return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic));
|
|
153908
|
-
case 2:
|
|
153909
|
-
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
153910
|
-
default:
|
|
153911
|
-
Debug.assertNever(diagnostic);
|
|
153912
|
-
}
|
|
153913
|
-
});
|
|
153914
|
-
lazyProgramDiagnosticExplainingFile.forEach(
|
|
153915
|
-
({ file, diagnostic, args }) => programDiagnostics.add(
|
|
153916
|
-
createDiagnosticExplainingFile(
|
|
153917
|
-
file,
|
|
153918
|
-
/*fileProcessingReason*/
|
|
153919
|
-
void 0,
|
|
153920
|
-
diagnostic,
|
|
153921
|
-
args
|
|
153922
|
-
)
|
|
153923
|
-
)
|
|
153924
|
-
);
|
|
153925
|
-
lazyProgramDiagnosticExplainingFile = void 0;
|
|
153926
|
-
fileReasonsToChain = void 0;
|
|
153927
|
-
reasonToRelatedInfo = void 0;
|
|
153928
|
-
}
|
|
153929
|
-
return programDiagnostics;
|
|
153930
|
-
}
|
|
153931
|
-
function filePreprocessingLibreferenceDiagnostic({ reason }) {
|
|
153932
|
-
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
153933
|
-
const libReference = file.libReferenceDirectives[reason.index];
|
|
153934
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
153935
|
-
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
153936
|
-
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
153937
|
-
return createFileDiagnostic(
|
|
153938
|
-
file,
|
|
153939
|
-
Debug.checkDefined(pos),
|
|
153940
|
-
Debug.checkDefined(end) - pos,
|
|
153941
|
-
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
153942
|
-
libName,
|
|
153943
|
-
suggestion
|
|
153944
|
-
);
|
|
153945
|
-
}
|
|
153946
154261
|
function getResolvedModule(file, moduleName2, mode) {
|
|
153947
154262
|
var _a22;
|
|
153948
154263
|
return (_a22 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a22.get(moduleName2, mode);
|
|
@@ -153991,7 +154306,7 @@ ${lanes.join("\n")}
|
|
|
153991
154306
|
function addResolutionDiagnostics(resolution) {
|
|
153992
154307
|
var _a22;
|
|
153993
154308
|
if (!((_a22 = resolution.resolutionDiagnostics) == null ? void 0 : _a22.length)) return;
|
|
153994
|
-
|
|
154309
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
153995
154310
|
kind: 2,
|
|
153996
154311
|
diagnostics: resolution.resolutionDiagnostics
|
|
153997
154312
|
});
|
|
@@ -154085,16 +154400,19 @@ ${lanes.join("\n")}
|
|
|
154085
154400
|
return toPath3(fileName, currentDirectory, getCanonicalFileName);
|
|
154086
154401
|
}
|
|
154087
154402
|
function getCommonSourceDirectory2() {
|
|
154088
|
-
|
|
154089
|
-
|
|
154090
|
-
commonSourceDirectory
|
|
154091
|
-
options,
|
|
154092
|
-
() => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
|
|
154093
|
-
currentDirectory,
|
|
154094
|
-
getCanonicalFileName,
|
|
154095
|
-
(commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
|
|
154096
|
-
);
|
|
154403
|
+
let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory();
|
|
154404
|
+
if (commonSourceDirectory !== void 0) {
|
|
154405
|
+
return commonSourceDirectory;
|
|
154097
154406
|
}
|
|
154407
|
+
const emittedFiles = filter(files, (file) => sourceFileMayBeEmitted(file, program));
|
|
154408
|
+
commonSourceDirectory = getCommonSourceDirectory(
|
|
154409
|
+
options,
|
|
154410
|
+
() => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
|
|
154411
|
+
currentDirectory,
|
|
154412
|
+
getCanonicalFileName,
|
|
154413
|
+
(commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
|
|
154414
|
+
);
|
|
154415
|
+
programDiagnostics.setCommonSourceDirectory(commonSourceDirectory);
|
|
154098
154416
|
return commonSourceDirectory;
|
|
154099
154417
|
}
|
|
154100
154418
|
function getClassifiableNames() {
|
|
@@ -154405,9 +154723,10 @@ ${lanes.join("\n")}
|
|
|
154405
154723
|
}
|
|
154406
154724
|
filesByName.set(path14, filesByName.get(oldFile.path));
|
|
154407
154725
|
});
|
|
154726
|
+
const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations);
|
|
154727
|
+
programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical);
|
|
154728
|
+
skipVerifyCompilerOptions = isConfigIdentical;
|
|
154408
154729
|
files = newSourceFiles;
|
|
154409
|
-
fileReasons = oldProgram.getFileIncludeReasons();
|
|
154410
|
-
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
|
154411
154730
|
automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames();
|
|
154412
154731
|
automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions();
|
|
154413
154732
|
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
|
@@ -154623,7 +154942,7 @@ ${lanes.join("\n")}
|
|
|
154623
154942
|
if (skipTypeChecking(sourceFile, options, program)) {
|
|
154624
154943
|
return emptyArray;
|
|
154625
154944
|
}
|
|
154626
|
-
const programDiagnosticsInFile =
|
|
154945
|
+
const programDiagnosticsInFile = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(sourceFile.fileName);
|
|
154627
154946
|
if (!((_a22 = sourceFile.commentDirectives) == null ? void 0 : _a22.length)) {
|
|
154628
154947
|
return programDiagnosticsInFile;
|
|
154629
154948
|
}
|
|
@@ -154997,15 +155316,15 @@ ${lanes.join("\n")}
|
|
|
154997
155316
|
}
|
|
154998
155317
|
function getOptionsDiagnostics() {
|
|
154999
155318
|
return sortAndDeduplicateDiagnostics(concatenate(
|
|
155000
|
-
|
|
155319
|
+
programDiagnostics.getCombinedDiagnostics(program).getGlobalDiagnostics(),
|
|
155001
155320
|
getOptionsDiagnosticsOfConfigFile()
|
|
155002
155321
|
));
|
|
155003
155322
|
}
|
|
155004
155323
|
function getOptionsDiagnosticsOfConfigFile() {
|
|
155005
155324
|
if (!options.configFile) return emptyArray;
|
|
155006
|
-
let diagnostics =
|
|
155325
|
+
let diagnostics = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(options.configFile.fileName);
|
|
155007
155326
|
forEachResolvedProjectReference2((resolvedRef) => {
|
|
155008
|
-
diagnostics = concatenate(diagnostics,
|
|
155327
|
+
diagnostics = concatenate(diagnostics, programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(resolvedRef.sourceFile.fileName));
|
|
155009
155328
|
});
|
|
155010
155329
|
return diagnostics;
|
|
155011
155330
|
}
|
|
@@ -155220,7 +155539,7 @@ ${lanes.join("\n")}
|
|
|
155220
155539
|
);
|
|
155221
155540
|
}
|
|
155222
155541
|
function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {
|
|
155223
|
-
const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(
|
|
155542
|
+
const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(programDiagnostics.getFileReasons().get(existingFile.path), isReferencedFile);
|
|
155224
155543
|
if (hasExistingReasonToReportErrorOn) {
|
|
155225
155544
|
addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);
|
|
155226
155545
|
} else {
|
|
@@ -155407,7 +155726,7 @@ ${lanes.join("\n")}
|
|
|
155407
155726
|
}
|
|
155408
155727
|
function addFileIncludeReason(file, reason, checkExisting) {
|
|
155409
155728
|
if (file && (!checkExisting || !isReferencedFile(reason) || !(filesWithReferencesProcessed == null ? void 0 : filesWithReferencesProcessed.has(reason.file)))) {
|
|
155410
|
-
|
|
155729
|
+
programDiagnostics.getFileReasons().add(file.path, reason);
|
|
155411
155730
|
return true;
|
|
155412
155731
|
}
|
|
155413
155732
|
return false;
|
|
@@ -155575,6 +155894,16 @@ ${lanes.join("\n")}
|
|
|
155575
155894
|
var _a22, _b22, _c22, _d2, _e2;
|
|
155576
155895
|
const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName);
|
|
155577
155896
|
if (existing) return existing;
|
|
155897
|
+
if (options.libReplacement === false) {
|
|
155898
|
+
const result2 = {
|
|
155899
|
+
resolution: {
|
|
155900
|
+
resolvedModule: void 0
|
|
155901
|
+
},
|
|
155902
|
+
actual: combinePaths(defaultLibraryPath, libFileName)
|
|
155903
|
+
};
|
|
155904
|
+
(resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2);
|
|
155905
|
+
return result2;
|
|
155906
|
+
}
|
|
155578
155907
|
if (structureIsReused !== 0 && oldProgram && !hasInvalidatedLibResolutions(libFileName)) {
|
|
155579
155908
|
const oldResolution = (_a22 = oldProgram.resolvedLibReferences) == null ? void 0 : _a22.get(libFileName);
|
|
155580
155909
|
if (oldResolution) {
|
|
@@ -155622,7 +155951,7 @@ ${lanes.join("\n")}
|
|
|
155622
155951
|
{ kind: 7, file: file.path, index }
|
|
155623
155952
|
);
|
|
155624
155953
|
} else {
|
|
155625
|
-
|
|
155954
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
155626
155955
|
kind: 0,
|
|
155627
155956
|
reason: { kind: 7, file: file.path, index }
|
|
155628
155957
|
});
|
|
@@ -155685,10 +156014,11 @@ ${lanes.join("\n")}
|
|
|
155685
156014
|
if (!sourceFile.isDeclarationFile) {
|
|
155686
156015
|
const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
|
155687
156016
|
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
|
155688
|
-
|
|
156017
|
+
programDiagnostics.addLazyConfigDiagnostic(
|
|
155689
156018
|
sourceFile,
|
|
155690
156019
|
Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
|
|
155691
|
-
|
|
156020
|
+
sourceFile.fileName,
|
|
156021
|
+
rootDirectory
|
|
155692
156022
|
);
|
|
155693
156023
|
allFilesBelongToPath = false;
|
|
155694
156024
|
}
|
|
@@ -155807,7 +156137,7 @@ ${lanes.join("\n")}
|
|
|
155807
156137
|
}
|
|
155808
156138
|
const outputFile = options.outFile;
|
|
155809
156139
|
if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) {
|
|
155810
|
-
programDiagnostics.
|
|
156140
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
155811
156141
|
}
|
|
155812
156142
|
verifyDeprecatedCompilerOptions();
|
|
155813
156143
|
verifyProjectReferences();
|
|
@@ -155815,10 +156145,11 @@ ${lanes.join("\n")}
|
|
|
155815
156145
|
const rootPaths = new Set(rootNames.map(toPath32));
|
|
155816
156146
|
for (const file of files) {
|
|
155817
156147
|
if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
|
155818
|
-
|
|
156148
|
+
programDiagnostics.addLazyConfigDiagnostic(
|
|
155819
156149
|
file,
|
|
155820
156150
|
Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
|
|
155821
|
-
|
|
156151
|
+
file.fileName,
|
|
156152
|
+
options.configFilePath || ""
|
|
155822
156153
|
);
|
|
155823
156154
|
}
|
|
155824
156155
|
}
|
|
@@ -155909,14 +156240,14 @@ ${lanes.join("\n")}
|
|
|
155909
156240
|
}
|
|
155910
156241
|
} else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === 0) {
|
|
155911
156242
|
const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
155912
|
-
programDiagnostics.
|
|
156243
|
+
programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
|
155913
156244
|
}
|
|
155914
156245
|
if (outputFile && !options.emitDeclarationOnly) {
|
|
155915
156246
|
if (options.module && !(options.module === 2 || options.module === 4)) {
|
|
155916
156247
|
createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, "outFile", "module");
|
|
155917
156248
|
} else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) {
|
|
155918
156249
|
const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
155919
|
-
programDiagnostics.
|
|
156250
|
+
programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile"));
|
|
155920
156251
|
}
|
|
155921
156252
|
}
|
|
155922
156253
|
if (getResolveJsonModule(options)) {
|
|
@@ -156005,7 +156336,8 @@ ${lanes.join("\n")}
|
|
|
156005
156336
|
}
|
|
156006
156337
|
if (ModuleKind[moduleKind] && (100 <= moduleKind && moduleKind <= 199) && !(3 <= moduleResolution && moduleResolution <= 99)) {
|
|
156007
156338
|
const moduleKindName = ModuleKind[moduleKind];
|
|
156008
|
-
|
|
156339
|
+
const moduleResolutionName = ModuleResolutionKind[moduleKindName] ? moduleKindName : "Node16";
|
|
156340
|
+
createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleResolutionName, moduleKindName);
|
|
156009
156341
|
} else if (ModuleResolutionKind[moduleResolution] && (3 <= moduleResolution && moduleResolution <= 99) && !(100 <= moduleKind && moduleKind <= 199)) {
|
|
156010
156342
|
const moduleResolutionName = ModuleResolutionKind[moduleResolution];
|
|
156011
156343
|
createOptionValueDiagnostic("module", Diagnostics.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, moduleResolutionName, moduleResolutionName);
|
|
@@ -156167,90 +156499,8 @@ ${lanes.join("\n")}
|
|
|
156167
156499
|
}
|
|
156168
156500
|
});
|
|
156169
156501
|
}
|
|
156170
|
-
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
156171
|
-
let seenReasons;
|
|
156172
|
-
const reasons = file && fileReasons.get(file.path);
|
|
156173
|
-
let fileIncludeReasons;
|
|
156174
|
-
let relatedInfo;
|
|
156175
|
-
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
156176
|
-
let fileIncludeReasonDetails;
|
|
156177
|
-
let redirectInfo;
|
|
156178
|
-
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
156179
|
-
let chain;
|
|
156180
|
-
if (cachedChain) {
|
|
156181
|
-
if (cachedChain.fileIncludeReasonDetails) {
|
|
156182
|
-
seenReasons = new Set(reasons);
|
|
156183
|
-
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
156184
|
-
} else {
|
|
156185
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
156186
|
-
}
|
|
156187
|
-
redirectInfo = cachedChain.redirectInfo;
|
|
156188
|
-
} else {
|
|
156189
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
156190
|
-
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file));
|
|
156191
|
-
}
|
|
156192
|
-
if (fileProcessingReason) processReason(fileProcessingReason);
|
|
156193
|
-
const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
|
|
156194
|
-
if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0;
|
|
156195
|
-
if (seenReasons && cachedChain) {
|
|
156196
|
-
if (cachedChain.details && !processedExtraReason) {
|
|
156197
|
-
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray);
|
|
156198
|
-
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
156199
|
-
if (!processedExtraReason) {
|
|
156200
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
156201
|
-
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
156202
|
-
} else {
|
|
156203
|
-
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
156204
|
-
}
|
|
156205
|
-
} else {
|
|
156206
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
156207
|
-
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
156208
|
-
} else {
|
|
156209
|
-
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
156210
|
-
}
|
|
156211
|
-
}
|
|
156212
|
-
}
|
|
156213
|
-
}
|
|
156214
|
-
if (!chain) {
|
|
156215
|
-
if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
156216
|
-
chain = chainDiagnosticMessages(
|
|
156217
|
-
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
156218
|
-
diagnostic,
|
|
156219
|
-
...args || emptyArray
|
|
156220
|
-
);
|
|
156221
|
-
}
|
|
156222
|
-
if (file) {
|
|
156223
|
-
if (cachedChain) {
|
|
156224
|
-
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
156225
|
-
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
156226
|
-
}
|
|
156227
|
-
} else {
|
|
156228
|
-
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
156229
|
-
}
|
|
156230
|
-
if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next;
|
|
156231
|
-
}
|
|
156232
|
-
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
156233
|
-
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
156234
|
-
function processReason(reason) {
|
|
156235
|
-
if (seenReasons == null ? void 0 : seenReasons.has(reason)) return;
|
|
156236
|
-
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
156237
|
-
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
156238
|
-
populateRelatedInfo(reason);
|
|
156239
|
-
}
|
|
156240
|
-
function populateRelatedInfo(reason) {
|
|
156241
|
-
if (!locationReason && isReferencedFile(reason)) {
|
|
156242
|
-
locationReason = reason;
|
|
156243
|
-
} else if (locationReason !== reason) {
|
|
156244
|
-
relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(reason));
|
|
156245
|
-
}
|
|
156246
|
-
}
|
|
156247
|
-
function cachedFileIncludeDetailsHasProcessedExtraReason() {
|
|
156248
|
-
var _a22;
|
|
156249
|
-
return ((_a22 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a22.length) !== (reasons == null ? void 0 : reasons.length);
|
|
156250
|
-
}
|
|
156251
|
-
}
|
|
156252
156502
|
function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {
|
|
156253
|
-
|
|
156503
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
156254
156504
|
kind: 1,
|
|
156255
156505
|
file: file && file.path,
|
|
156256
156506
|
fileProcessingReason,
|
|
@@ -156258,99 +156508,6 @@ ${lanes.join("\n")}
|
|
|
156258
156508
|
args
|
|
156259
156509
|
});
|
|
156260
156510
|
}
|
|
156261
|
-
function addLazyProgramDiagnosticExplainingFile(file, diagnostic, args) {
|
|
156262
|
-
lazyProgramDiagnosticExplainingFile.push({ file, diagnostic, args });
|
|
156263
|
-
}
|
|
156264
|
-
function getFileIncludeReasonToRelatedInformation(reason) {
|
|
156265
|
-
let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
|
|
156266
|
-
if (relatedInfo === void 0) (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(reason) ?? false);
|
|
156267
|
-
return relatedInfo || void 0;
|
|
156268
|
-
}
|
|
156269
|
-
function fileIncludeReasonToRelatedInformation(reason) {
|
|
156270
|
-
if (isReferencedFile(reason)) {
|
|
156271
|
-
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
156272
|
-
let message22;
|
|
156273
|
-
switch (reason.kind) {
|
|
156274
|
-
case 3:
|
|
156275
|
-
message22 = Diagnostics.File_is_included_via_import_here;
|
|
156276
|
-
break;
|
|
156277
|
-
case 4:
|
|
156278
|
-
message22 = Diagnostics.File_is_included_via_reference_here;
|
|
156279
|
-
break;
|
|
156280
|
-
case 5:
|
|
156281
|
-
message22 = Diagnostics.File_is_included_via_type_library_reference_here;
|
|
156282
|
-
break;
|
|
156283
|
-
case 7:
|
|
156284
|
-
message22 = Diagnostics.File_is_included_via_library_reference_here;
|
|
156285
|
-
break;
|
|
156286
|
-
default:
|
|
156287
|
-
Debug.assertNever(reason);
|
|
156288
|
-
}
|
|
156289
|
-
return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
|
|
156290
|
-
referenceLocation.file,
|
|
156291
|
-
referenceLocation.pos,
|
|
156292
|
-
referenceLocation.end - referenceLocation.pos,
|
|
156293
|
-
message22
|
|
156294
|
-
) : void 0;
|
|
156295
|
-
}
|
|
156296
|
-
if (!options.configFile) return void 0;
|
|
156297
|
-
let configFileNode;
|
|
156298
|
-
let message2;
|
|
156299
|
-
switch (reason.kind) {
|
|
156300
|
-
case 0:
|
|
156301
|
-
if (!options.configFile.configFileSpecs) return void 0;
|
|
156302
|
-
const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
|
|
156303
|
-
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
156304
|
-
if (matchedByFiles) {
|
|
156305
|
-
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
156306
|
-
message2 = Diagnostics.File_is_matched_by_files_list_specified_here;
|
|
156307
|
-
break;
|
|
156308
|
-
}
|
|
156309
|
-
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
156310
|
-
if (!matchedByInclude || !isString(matchedByInclude)) return void 0;
|
|
156311
|
-
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
156312
|
-
message2 = Diagnostics.File_is_matched_by_include_pattern_specified_here;
|
|
156313
|
-
break;
|
|
156314
|
-
case 1:
|
|
156315
|
-
case 2:
|
|
156316
|
-
const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
|
|
156317
|
-
const referenceInfo = forEachProjectReference(
|
|
156318
|
-
projectReferences,
|
|
156319
|
-
resolvedProjectReferences,
|
|
156320
|
-
(resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
|
|
156321
|
-
);
|
|
156322
|
-
if (!referenceInfo) return void 0;
|
|
156323
|
-
const { sourceFile, index } = referenceInfo;
|
|
156324
|
-
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
156325
|
-
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
156326
|
-
sourceFile,
|
|
156327
|
-
referencesSyntax.elements[index],
|
|
156328
|
-
reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
|
|
156329
|
-
) : void 0;
|
|
156330
|
-
case 8:
|
|
156331
|
-
if (!options.types) return void 0;
|
|
156332
|
-
configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
|
|
156333
|
-
message2 = Diagnostics.File_is_entry_point_of_type_library_specified_here;
|
|
156334
|
-
break;
|
|
156335
|
-
case 6:
|
|
156336
|
-
if (reason.index !== void 0) {
|
|
156337
|
-
configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
|
|
156338
|
-
message2 = Diagnostics.File_is_library_specified_here;
|
|
156339
|
-
break;
|
|
156340
|
-
}
|
|
156341
|
-
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
156342
|
-
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
156343
|
-
message2 = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
156344
|
-
break;
|
|
156345
|
-
default:
|
|
156346
|
-
Debug.assertNever(reason);
|
|
156347
|
-
}
|
|
156348
|
-
return configFileNode && createDiagnosticForNodeInSourceFile(
|
|
156349
|
-
options.configFile,
|
|
156350
|
-
configFileNode,
|
|
156351
|
-
message2
|
|
156352
|
-
);
|
|
156353
|
-
}
|
|
156354
156511
|
function verifyProjectReferences() {
|
|
156355
156512
|
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0;
|
|
156356
156513
|
forEachProjectReference(
|
|
@@ -156386,7 +156543,7 @@ ${lanes.join("\n")}
|
|
|
156386
156543
|
forEachPropertyAssignment(pathProp.initializer, key, (keyProps) => {
|
|
156387
156544
|
const initializer = keyProps.initializer;
|
|
156388
156545
|
if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {
|
|
156389
|
-
programDiagnostics.
|
|
156546
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message2, ...args));
|
|
156390
156547
|
needCompilerDiagnostic = false;
|
|
156391
156548
|
}
|
|
156392
156549
|
});
|
|
@@ -156415,18 +156572,8 @@ ${lanes.join("\n")}
|
|
|
156415
156572
|
createCompilerOptionsDiagnostic(message2, ...args);
|
|
156416
156573
|
}
|
|
156417
156574
|
}
|
|
156418
|
-
function forEachOptionsSyntaxByName(name, callback) {
|
|
156419
|
-
return forEachPropertyAssignment(getCompilerOptionsObjectLiteralSyntax(), name, callback);
|
|
156420
|
-
}
|
|
156421
156575
|
function forEachOptionPathsSyntax(callback) {
|
|
156422
|
-
return forEachOptionsSyntaxByName("paths", callback);
|
|
156423
|
-
}
|
|
156424
|
-
function getOptionsSyntaxByValue(name, value2) {
|
|
156425
|
-
return forEachOptionsSyntaxByName(name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value2 ? property.initializer : void 0);
|
|
156426
|
-
}
|
|
156427
|
-
function getOptionsSyntaxByArrayElementValue(name, value2) {
|
|
156428
|
-
const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
|
|
156429
|
-
return compilerOptionsObjectLiteralSyntax && getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name, value2);
|
|
156576
|
+
return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(), "paths", callback);
|
|
156430
156577
|
}
|
|
156431
156578
|
function createDiagnosticForOptionName(message2, option1, option2, option3) {
|
|
156432
156579
|
createDiagnosticForOption(
|
|
@@ -156454,9 +156601,9 @@ ${lanes.join("\n")}
|
|
|
156454
156601
|
function createDiagnosticForReference(sourceFile, index, message2, ...args) {
|
|
156455
156602
|
const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
156456
156603
|
if (referencesSyntax && referencesSyntax.elements.length > index) {
|
|
156457
|
-
programDiagnostics.
|
|
156604
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message2, ...args));
|
|
156458
156605
|
} else {
|
|
156459
|
-
programDiagnostics.
|
|
156606
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message2, ...args));
|
|
156460
156607
|
}
|
|
156461
156608
|
}
|
|
156462
156609
|
function createDiagnosticForOption(onKey, option1, option2, message2, ...args) {
|
|
@@ -156470,14 +156617,14 @@ ${lanes.join("\n")}
|
|
|
156470
156617
|
const compilerOptionsProperty = getCompilerOptionsPropertySyntax();
|
|
156471
156618
|
if (compilerOptionsProperty) {
|
|
156472
156619
|
if ("messageText" in message2) {
|
|
156473
|
-
programDiagnostics.
|
|
156620
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, compilerOptionsProperty.name, message2));
|
|
156474
156621
|
} else {
|
|
156475
|
-
programDiagnostics.
|
|
156622
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, compilerOptionsProperty.name, message2, ...args));
|
|
156476
156623
|
}
|
|
156477
156624
|
} else if ("messageText" in message2) {
|
|
156478
|
-
programDiagnostics.
|
|
156625
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(message2));
|
|
156479
156626
|
} else {
|
|
156480
|
-
programDiagnostics.
|
|
156627
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message2, ...args));
|
|
156481
156628
|
}
|
|
156482
156629
|
}
|
|
156483
156630
|
function getCompilerOptionsObjectLiteralSyntax() {
|
|
@@ -156501,9 +156648,9 @@ ${lanes.join("\n")}
|
|
|
156501
156648
|
let needsCompilerDiagnostic = false;
|
|
156502
156649
|
forEachPropertyAssignment(objectLiteral, key1, (prop) => {
|
|
156503
156650
|
if ("messageText" in message2) {
|
|
156504
|
-
programDiagnostics.
|
|
156651
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message2));
|
|
156505
156652
|
} else {
|
|
156506
|
-
programDiagnostics.
|
|
156653
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message2, ...args));
|
|
156507
156654
|
}
|
|
156508
156655
|
needsCompilerDiagnostic = true;
|
|
156509
156656
|
}, key2);
|
|
@@ -156511,7 +156658,7 @@ ${lanes.join("\n")}
|
|
|
156511
156658
|
}
|
|
156512
156659
|
function blockEmittingOfFile(emitFileName, diag2) {
|
|
156513
156660
|
hasEmitBlockingDiagnostics.set(toPath32(emitFileName), true);
|
|
156514
|
-
programDiagnostics.
|
|
156661
|
+
programDiagnostics.addConfigDiagnostic(diag2);
|
|
156515
156662
|
}
|
|
156516
156663
|
function isEmittedFile(file) {
|
|
156517
156664
|
if (options.noEmit) {
|
|
@@ -156851,6 +156998,291 @@ ${lanes.join("\n")}
|
|
|
156851
156998
|
}
|
|
156852
156999
|
Debug.fail("should never ask for module name at index higher than possible module name");
|
|
156853
157000
|
}
|
|
157001
|
+
function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax) {
|
|
157002
|
+
let computedDiagnostics;
|
|
157003
|
+
let fileReasons = createMultiMap();
|
|
157004
|
+
let fileProcessingDiagnostics;
|
|
157005
|
+
let commonSourceDirectory;
|
|
157006
|
+
let configDiagnostics;
|
|
157007
|
+
let lazyConfigDiagnostics;
|
|
157008
|
+
let fileReasonsToChain;
|
|
157009
|
+
let reasonToRelatedInfo;
|
|
157010
|
+
return {
|
|
157011
|
+
addConfigDiagnostic(diag2) {
|
|
157012
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157013
|
+
(configDiagnostics ?? (configDiagnostics = createDiagnosticCollection())).add(diag2);
|
|
157014
|
+
},
|
|
157015
|
+
addLazyConfigDiagnostic(file, message2, ...args) {
|
|
157016
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157017
|
+
(lazyConfigDiagnostics ?? (lazyConfigDiagnostics = [])).push({ file, diagnostic: message2, args });
|
|
157018
|
+
},
|
|
157019
|
+
addFileProcessingDiagnostic(diag2) {
|
|
157020
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157021
|
+
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push(diag2);
|
|
157022
|
+
},
|
|
157023
|
+
setCommonSourceDirectory(directory) {
|
|
157024
|
+
commonSourceDirectory = directory;
|
|
157025
|
+
},
|
|
157026
|
+
reuseStateFromOldProgram(oldProgramDiagnostics, isConfigIdentical) {
|
|
157027
|
+
fileReasons = oldProgramDiagnostics.getFileReasons();
|
|
157028
|
+
fileProcessingDiagnostics = oldProgramDiagnostics.getFileProcessingDiagnostics();
|
|
157029
|
+
if (isConfigIdentical) {
|
|
157030
|
+
commonSourceDirectory = oldProgramDiagnostics.getCommonSourceDirectory();
|
|
157031
|
+
configDiagnostics = oldProgramDiagnostics.getConfigDiagnostics();
|
|
157032
|
+
lazyConfigDiagnostics = oldProgramDiagnostics.getLazyConfigDiagnostics();
|
|
157033
|
+
}
|
|
157034
|
+
},
|
|
157035
|
+
getFileProcessingDiagnostics() {
|
|
157036
|
+
return fileProcessingDiagnostics;
|
|
157037
|
+
},
|
|
157038
|
+
getFileReasons() {
|
|
157039
|
+
return fileReasons;
|
|
157040
|
+
},
|
|
157041
|
+
getCommonSourceDirectory() {
|
|
157042
|
+
return commonSourceDirectory;
|
|
157043
|
+
},
|
|
157044
|
+
getConfigDiagnostics() {
|
|
157045
|
+
return configDiagnostics;
|
|
157046
|
+
},
|
|
157047
|
+
getLazyConfigDiagnostics() {
|
|
157048
|
+
return lazyConfigDiagnostics;
|
|
157049
|
+
},
|
|
157050
|
+
getCombinedDiagnostics(program) {
|
|
157051
|
+
if (computedDiagnostics) {
|
|
157052
|
+
return computedDiagnostics;
|
|
157053
|
+
}
|
|
157054
|
+
computedDiagnostics = createDiagnosticCollection();
|
|
157055
|
+
configDiagnostics == null ? void 0 : configDiagnostics.getDiagnostics().forEach((d) => computedDiagnostics.add(d));
|
|
157056
|
+
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
157057
|
+
switch (diagnostic.kind) {
|
|
157058
|
+
case 1:
|
|
157059
|
+
return computedDiagnostics.add(
|
|
157060
|
+
createDiagnosticExplainingFile(
|
|
157061
|
+
program,
|
|
157062
|
+
diagnostic.file && program.getSourceFileByPath(diagnostic.file),
|
|
157063
|
+
diagnostic.fileProcessingReason,
|
|
157064
|
+
diagnostic.diagnostic,
|
|
157065
|
+
diagnostic.args || emptyArray
|
|
157066
|
+
)
|
|
157067
|
+
);
|
|
157068
|
+
case 0:
|
|
157069
|
+
return computedDiagnostics.add(filePreprocessingLibreferenceDiagnostic(program, diagnostic));
|
|
157070
|
+
case 2:
|
|
157071
|
+
return diagnostic.diagnostics.forEach((d) => computedDiagnostics.add(d));
|
|
157072
|
+
default:
|
|
157073
|
+
Debug.assertNever(diagnostic);
|
|
157074
|
+
}
|
|
157075
|
+
});
|
|
157076
|
+
lazyConfigDiagnostics == null ? void 0 : lazyConfigDiagnostics.forEach(
|
|
157077
|
+
({ file, diagnostic, args }) => computedDiagnostics.add(
|
|
157078
|
+
createDiagnosticExplainingFile(
|
|
157079
|
+
program,
|
|
157080
|
+
file,
|
|
157081
|
+
/*fileProcessingReason*/
|
|
157082
|
+
void 0,
|
|
157083
|
+
diagnostic,
|
|
157084
|
+
args
|
|
157085
|
+
)
|
|
157086
|
+
)
|
|
157087
|
+
);
|
|
157088
|
+
fileReasonsToChain = void 0;
|
|
157089
|
+
reasonToRelatedInfo = void 0;
|
|
157090
|
+
return computedDiagnostics;
|
|
157091
|
+
}
|
|
157092
|
+
};
|
|
157093
|
+
function filePreprocessingLibreferenceDiagnostic(program, { reason }) {
|
|
157094
|
+
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
157095
|
+
const libReference = file.libReferenceDirectives[reason.index];
|
|
157096
|
+
const libName = getLibNameFromLibReference(libReference);
|
|
157097
|
+
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
157098
|
+
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
157099
|
+
return createFileDiagnostic(
|
|
157100
|
+
file,
|
|
157101
|
+
Debug.checkDefined(pos),
|
|
157102
|
+
Debug.checkDefined(end) - pos,
|
|
157103
|
+
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
157104
|
+
libName,
|
|
157105
|
+
suggestion
|
|
157106
|
+
);
|
|
157107
|
+
}
|
|
157108
|
+
function createDiagnosticExplainingFile(program, file, fileProcessingReason, diagnostic, args) {
|
|
157109
|
+
let seenReasons;
|
|
157110
|
+
let fileIncludeReasons;
|
|
157111
|
+
let relatedInfo;
|
|
157112
|
+
let fileIncludeReasonDetails;
|
|
157113
|
+
let redirectInfo;
|
|
157114
|
+
let chain;
|
|
157115
|
+
const reasons = file && fileReasons.get(file.path);
|
|
157116
|
+
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
157117
|
+
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
157118
|
+
if (cachedChain) {
|
|
157119
|
+
if (cachedChain.fileIncludeReasonDetails) {
|
|
157120
|
+
seenReasons = new Set(reasons);
|
|
157121
|
+
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
157122
|
+
} else {
|
|
157123
|
+
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
157124
|
+
}
|
|
157125
|
+
redirectInfo = cachedChain.redirectInfo;
|
|
157126
|
+
} else {
|
|
157127
|
+
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
157128
|
+
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file));
|
|
157129
|
+
}
|
|
157130
|
+
if (fileProcessingReason) processReason(fileProcessingReason);
|
|
157131
|
+
const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
|
|
157132
|
+
if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0;
|
|
157133
|
+
if (seenReasons && cachedChain) {
|
|
157134
|
+
if (cachedChain.details && !processedExtraReason) {
|
|
157135
|
+
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args ?? emptyArray);
|
|
157136
|
+
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
157137
|
+
if (!processedExtraReason) {
|
|
157138
|
+
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
157139
|
+
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
157140
|
+
} else {
|
|
157141
|
+
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
157142
|
+
}
|
|
157143
|
+
} else {
|
|
157144
|
+
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
157145
|
+
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
157146
|
+
} else {
|
|
157147
|
+
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
157148
|
+
}
|
|
157149
|
+
}
|
|
157150
|
+
}
|
|
157151
|
+
}
|
|
157152
|
+
if (!chain) {
|
|
157153
|
+
if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
157154
|
+
chain = chainDiagnosticMessages(
|
|
157155
|
+
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
157156
|
+
diagnostic,
|
|
157157
|
+
...args || emptyArray
|
|
157158
|
+
);
|
|
157159
|
+
}
|
|
157160
|
+
if (file) {
|
|
157161
|
+
if (cachedChain) {
|
|
157162
|
+
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
157163
|
+
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
157164
|
+
}
|
|
157165
|
+
} else {
|
|
157166
|
+
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
157167
|
+
}
|
|
157168
|
+
if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next;
|
|
157169
|
+
}
|
|
157170
|
+
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
157171
|
+
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
157172
|
+
function processReason(reason) {
|
|
157173
|
+
if (seenReasons == null ? void 0 : seenReasons.has(reason)) return;
|
|
157174
|
+
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
157175
|
+
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
157176
|
+
populateRelatedInfo(reason);
|
|
157177
|
+
}
|
|
157178
|
+
function populateRelatedInfo(reason) {
|
|
157179
|
+
if (!locationReason && isReferencedFile(reason)) {
|
|
157180
|
+
locationReason = reason;
|
|
157181
|
+
} else if (locationReason !== reason) {
|
|
157182
|
+
relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(program, reason));
|
|
157183
|
+
}
|
|
157184
|
+
}
|
|
157185
|
+
function cachedFileIncludeDetailsHasProcessedExtraReason() {
|
|
157186
|
+
var _a2;
|
|
157187
|
+
return ((_a2 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a2.length) !== (reasons == null ? void 0 : reasons.length);
|
|
157188
|
+
}
|
|
157189
|
+
}
|
|
157190
|
+
function getFileIncludeReasonToRelatedInformation(program, reason) {
|
|
157191
|
+
let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
|
|
157192
|
+
if (relatedInfo === void 0) (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(program, reason) ?? false);
|
|
157193
|
+
return relatedInfo || void 0;
|
|
157194
|
+
}
|
|
157195
|
+
function fileIncludeReasonToRelatedInformation(program, reason) {
|
|
157196
|
+
if (isReferencedFile(reason)) {
|
|
157197
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
157198
|
+
let message22;
|
|
157199
|
+
switch (reason.kind) {
|
|
157200
|
+
case 3:
|
|
157201
|
+
message22 = Diagnostics.File_is_included_via_import_here;
|
|
157202
|
+
break;
|
|
157203
|
+
case 4:
|
|
157204
|
+
message22 = Diagnostics.File_is_included_via_reference_here;
|
|
157205
|
+
break;
|
|
157206
|
+
case 5:
|
|
157207
|
+
message22 = Diagnostics.File_is_included_via_type_library_reference_here;
|
|
157208
|
+
break;
|
|
157209
|
+
case 7:
|
|
157210
|
+
message22 = Diagnostics.File_is_included_via_library_reference_here;
|
|
157211
|
+
break;
|
|
157212
|
+
default:
|
|
157213
|
+
Debug.assertNever(reason);
|
|
157214
|
+
}
|
|
157215
|
+
return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
|
|
157216
|
+
referenceLocation.file,
|
|
157217
|
+
referenceLocation.pos,
|
|
157218
|
+
referenceLocation.end - referenceLocation.pos,
|
|
157219
|
+
message22
|
|
157220
|
+
) : void 0;
|
|
157221
|
+
}
|
|
157222
|
+
const currentDirectory = program.getCurrentDirectory();
|
|
157223
|
+
const rootNames = program.getRootFileNames();
|
|
157224
|
+
const options = program.getCompilerOptions();
|
|
157225
|
+
if (!options.configFile) return void 0;
|
|
157226
|
+
let configFileNode;
|
|
157227
|
+
let message2;
|
|
157228
|
+
switch (reason.kind) {
|
|
157229
|
+
case 0:
|
|
157230
|
+
if (!options.configFile.configFileSpecs) return void 0;
|
|
157231
|
+
const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
|
|
157232
|
+
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
157233
|
+
if (matchedByFiles) {
|
|
157234
|
+
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
157235
|
+
message2 = Diagnostics.File_is_matched_by_files_list_specified_here;
|
|
157236
|
+
break;
|
|
157237
|
+
}
|
|
157238
|
+
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
157239
|
+
if (!matchedByInclude || !isString(matchedByInclude)) return void 0;
|
|
157240
|
+
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
157241
|
+
message2 = Diagnostics.File_is_matched_by_include_pattern_specified_here;
|
|
157242
|
+
break;
|
|
157243
|
+
case 1:
|
|
157244
|
+
case 2:
|
|
157245
|
+
const resolvedProjectReferences = program.getResolvedProjectReferences();
|
|
157246
|
+
const projectReferences = program.getProjectReferences();
|
|
157247
|
+
const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
|
|
157248
|
+
const referenceInfo = forEachProjectReference(
|
|
157249
|
+
projectReferences,
|
|
157250
|
+
resolvedProjectReferences,
|
|
157251
|
+
(resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
|
|
157252
|
+
);
|
|
157253
|
+
if (!referenceInfo) return void 0;
|
|
157254
|
+
const { sourceFile, index } = referenceInfo;
|
|
157255
|
+
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
157256
|
+
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
157257
|
+
sourceFile,
|
|
157258
|
+
referencesSyntax.elements[index],
|
|
157259
|
+
reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
|
|
157260
|
+
) : void 0;
|
|
157261
|
+
case 8:
|
|
157262
|
+
if (!options.types) return void 0;
|
|
157263
|
+
configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "types", reason.typeReference);
|
|
157264
|
+
message2 = Diagnostics.File_is_entry_point_of_type_library_specified_here;
|
|
157265
|
+
break;
|
|
157266
|
+
case 6:
|
|
157267
|
+
if (reason.index !== void 0) {
|
|
157268
|
+
configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "lib", options.lib[reason.index]);
|
|
157269
|
+
message2 = Diagnostics.File_is_library_specified_here;
|
|
157270
|
+
break;
|
|
157271
|
+
}
|
|
157272
|
+
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
157273
|
+
configFileNode = target ? getOptionsSyntaxByValue(getCompilerOptionsObjectLiteralSyntax(), "target", target) : void 0;
|
|
157274
|
+
message2 = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
157275
|
+
break;
|
|
157276
|
+
default:
|
|
157277
|
+
Debug.assertNever(reason);
|
|
157278
|
+
}
|
|
157279
|
+
return configFileNode && createDiagnosticForNodeInSourceFile(
|
|
157280
|
+
options.configFile,
|
|
157281
|
+
configFileNode,
|
|
157282
|
+
message2
|
|
157283
|
+
);
|
|
157284
|
+
}
|
|
157285
|
+
}
|
|
156854
157286
|
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
|
|
156855
157287
|
const outputFiles = [];
|
|
156856
157288
|
const { emitSkipped, diagnostics } = program.emit(sourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit);
|
|
@@ -165258,18 +165690,21 @@ ${lanes.join("\n")}
|
|
|
165258
165690
|
return failed;
|
|
165259
165691
|
}
|
|
165260
165692
|
function typeFromFunctionLikeExpression(fnNode, context) {
|
|
165261
|
-
const
|
|
165262
|
-
context.noInferenceFallback = true;
|
|
165263
|
-
createReturnFromSignature(
|
|
165693
|
+
const returnType = createReturnFromSignature(
|
|
165264
165694
|
fnNode,
|
|
165265
165695
|
/*symbol*/
|
|
165266
165696
|
void 0,
|
|
165267
165697
|
context
|
|
165268
165698
|
);
|
|
165269
|
-
reuseTypeParameters(fnNode.typeParameters, context);
|
|
165270
|
-
fnNode.parameters.map((p) => ensureParameter(p, context));
|
|
165271
|
-
|
|
165272
|
-
|
|
165699
|
+
const typeParameters = reuseTypeParameters(fnNode.typeParameters, context);
|
|
165700
|
+
const parameters = fnNode.parameters.map((p) => ensureParameter(p, context));
|
|
165701
|
+
return syntacticResult(
|
|
165702
|
+
factory.createFunctionTypeNode(
|
|
165703
|
+
typeParameters,
|
|
165704
|
+
parameters,
|
|
165705
|
+
returnType
|
|
165706
|
+
)
|
|
165707
|
+
);
|
|
165273
165708
|
}
|
|
165274
165709
|
function canGetTypeFromArrayLiteral(arrayLiteral, context, isConstContext) {
|
|
165275
165710
|
if (!isConstContext) {
|
|
@@ -168992,7 +169427,7 @@ ${lanes.join("\n")}
|
|
|
168992
169427
|
return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes2(moduleSymbol.name)), target, forceCapitalize);
|
|
168993
169428
|
}
|
|
168994
169429
|
function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) {
|
|
168995
|
-
const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
|
|
169430
|
+
const baseName = getBaseFileName(removeSuffix(removeFileExtension(moduleSpecifier), "/index"));
|
|
168996
169431
|
let res = "";
|
|
168997
169432
|
let lastCharWasValid = true;
|
|
168998
169433
|
const firstCharCode = baseName.charCodeAt(0);
|
|
@@ -175153,7 +175588,7 @@ interface Symbol {
|
|
|
175153
175588
|
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
|
|
175154
175589
|
for (const statement of toMove) {
|
|
175155
175590
|
forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
|
|
175156
|
-
if (!symbol.declarations) {
|
|
175591
|
+
if (!some(symbol.declarations)) {
|
|
175157
175592
|
return;
|
|
175158
175593
|
}
|
|
175159
175594
|
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
|
|
@@ -185945,6 +186380,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
185945
186380
|
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
|
|
185946
186381
|
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
|
|
185947
186382
|
Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
186383
|
+
Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code,
|
|
185948
186384
|
Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code
|
|
185949
186385
|
];
|
|
185950
186386
|
registerCodeFix({
|
|
@@ -187060,6 +187496,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
187060
187496
|
case 200:
|
|
187061
187497
|
return 2;
|
|
187062
187498
|
case 100:
|
|
187499
|
+
case 101:
|
|
187063
187500
|
case 199:
|
|
187064
187501
|
return getImpliedNodeFormatForEmit(importingFile, program) === 99 ? 2 : 3;
|
|
187065
187502
|
default:
|
|
@@ -188486,7 +188923,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188486
188923
|
Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,
|
|
188487
188924
|
Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,
|
|
188488
188925
|
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
|
|
188489
|
-
Diagnostics.Cannot_find_name_0.code
|
|
188926
|
+
Diagnostics.Cannot_find_name_0.code,
|
|
188927
|
+
Diagnostics.Type_0_does_not_satisfy_the_expected_type_1.code
|
|
188490
188928
|
];
|
|
188491
188929
|
registerCodeFix({
|
|
188492
188930
|
errorCodes: errorCodes28,
|
|
@@ -188523,9 +188961,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188523
188961
|
return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
|
|
188524
188962
|
eachDiagnostic(context, errorCodes28, (diag2) => {
|
|
188525
188963
|
const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
|
|
188526
|
-
if (
|
|
188527
|
-
|
|
188528
|
-
|
|
188964
|
+
if (info === void 0) return;
|
|
188965
|
+
const nodeId = getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 ? info.identifier || getNodeId(info.token) : info.token.text);
|
|
188966
|
+
if (!addToSeen(seen, nodeId)) return;
|
|
188529
188967
|
if (fixId56 === fixMissingFunctionDeclaration && (info.kind === 2 || info.kind === 5)) {
|
|
188530
188968
|
addFunctionDeclaration(changes, context, info);
|
|
188531
188969
|
} else if (fixId56 === fixMissingProperties && info.kind === 3) {
|
|
@@ -188577,7 +189015,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188577
189015
|
}
|
|
188578
189016
|
});
|
|
188579
189017
|
function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
188580
|
-
var _a2, _b2
|
|
189018
|
+
var _a2, _b2;
|
|
188581
189019
|
const token = getTokenAtPosition(sourceFile, tokenPos);
|
|
188582
189020
|
const parent2 = token.parent;
|
|
188583
189021
|
if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
|
|
@@ -188599,23 +189037,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188599
189037
|
if (!length(properties)) return void 0;
|
|
188600
189038
|
return { kind: 3, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
|
|
188601
189039
|
}
|
|
188602
|
-
if (token.kind === 19
|
|
188603
|
-
const
|
|
188604
|
-
|
|
188605
|
-
checker.
|
|
188606
|
-
|
|
188607
|
-
|
|
188608
|
-
|
|
188609
|
-
|
|
188610
|
-
|
|
188611
|
-
|
|
188612
|
-
|
|
188613
|
-
|
|
188614
|
-
|
|
189040
|
+
if (token.kind === 19 || isSatisfiesExpression(parent2) || isReturnStatement(parent2)) {
|
|
189041
|
+
const expression = (isSatisfiesExpression(parent2) || isReturnStatement(parent2)) && parent2.expression ? parent2.expression : parent2;
|
|
189042
|
+
if (isObjectLiteralExpression(expression)) {
|
|
189043
|
+
const targetType = isSatisfiesExpression(parent2) ? checker.getTypeFromTypeNode(parent2.type) : checker.getContextualType(expression) || checker.getTypeAtLocation(expression);
|
|
189044
|
+
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
189045
|
+
checker.getTypeAtLocation(parent2),
|
|
189046
|
+
targetType.getNonNullableType(),
|
|
189047
|
+
/*requireOptionalProperties*/
|
|
189048
|
+
false,
|
|
189049
|
+
/*matchDiscriminantProperties*/
|
|
189050
|
+
false
|
|
189051
|
+
));
|
|
189052
|
+
if (!length(properties)) return void 0;
|
|
189053
|
+
return { kind: 3, token: parent2, identifier: void 0, properties, parentDeclaration: expression, indentation: isReturnStatement(expression.parent) || isYieldExpression(expression.parent) ? 0 : void 0 };
|
|
189054
|
+
}
|
|
188615
189055
|
}
|
|
188616
189056
|
if (!isMemberName(token)) return void 0;
|
|
188617
189057
|
if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
|
|
188618
|
-
const targetType = (
|
|
189058
|
+
const targetType = (_a2 = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _a2.getNonNullableType();
|
|
188619
189059
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
188620
189060
|
checker.getTypeAtLocation(parent2.initializer),
|
|
188621
189061
|
targetType,
|
|
@@ -188634,7 +189074,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188634
189074
|
return { kind: 4, token, attributes, parentDeclaration: token.parent };
|
|
188635
189075
|
}
|
|
188636
189076
|
if (isIdentifier(token)) {
|
|
188637
|
-
const type = (
|
|
189077
|
+
const type = (_b2 = checker.getContextualType(token)) == null ? void 0 : _b2.getNonNullableType();
|
|
188638
189078
|
if (type && getObjectFlags(type) & 16) {
|
|
188639
189079
|
const signature = firstOrUndefined(checker.getSignaturesOfType(
|
|
188640
189080
|
type,
|
|
@@ -189676,9 +190116,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
189676
190116
|
}
|
|
189677
190117
|
registerCodeFix({
|
|
189678
190118
|
errorCodes: [
|
|
189679
|
-
Diagnostics.
|
|
189680
|
-
Diagnostics.
|
|
189681
|
-
Diagnostics.
|
|
190119
|
+
Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
|
|
190120
|
+
Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
|
|
190121
|
+
Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
|
|
189682
190122
|
],
|
|
189683
190123
|
getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
|
|
189684
190124
|
const compilerOptions = context.program.getCompilerOptions();
|
|
@@ -190139,6 +190579,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190139
190579
|
break;
|
|
190140
190580
|
} else if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
190141
190581
|
deleteEntireVariableStatement(changes, sourceFile, token.parent);
|
|
190582
|
+
} else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) {
|
|
190583
|
+
deleteFunctionLikeDeclaration(changes, sourceFile, token.parent);
|
|
190142
190584
|
} else {
|
|
190143
190585
|
tryDeleteDeclaration(
|
|
190144
190586
|
sourceFile,
|
|
@@ -193246,12 +193688,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
193246
193688
|
return typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget);
|
|
193247
193689
|
}
|
|
193248
193690
|
function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
|
|
193249
|
-
|
|
193250
|
-
|
|
193251
|
-
|
|
193252
|
-
|
|
193253
|
-
typeNode = importableReference.typeNode;
|
|
193254
|
-
}
|
|
193691
|
+
const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
|
|
193692
|
+
if (importableReference) {
|
|
193693
|
+
importSymbols(importAdder, importableReference.symbols);
|
|
193694
|
+
typeNode = importableReference.typeNode;
|
|
193255
193695
|
}
|
|
193256
193696
|
return getSynthesizedDeepClone(typeNode);
|
|
193257
193697
|
}
|
|
@@ -202069,7 +202509,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202069
202509
|
} else {
|
|
202070
202510
|
addIfImplementation(body);
|
|
202071
202511
|
}
|
|
202072
|
-
} else if (isAssertionExpression(typeHavingNode)) {
|
|
202512
|
+
} else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) {
|
|
202073
202513
|
addIfImplementation(typeHavingNode.expression);
|
|
202074
202514
|
}
|
|
202075
202515
|
}
|
|
@@ -202537,7 +202977,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202537
202977
|
const { parent: parent2 } = node;
|
|
202538
202978
|
const typeChecker = program.getTypeChecker();
|
|
202539
202979
|
if (node.kind === 164 || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) {
|
|
202540
|
-
|
|
202980
|
+
const def = getDefinitionFromOverriddenMember(typeChecker, node);
|
|
202981
|
+
if (def !== void 0 || node.kind !== 164) {
|
|
202982
|
+
return def || emptyArray;
|
|
202983
|
+
}
|
|
202541
202984
|
}
|
|
202542
202985
|
if (isJumpStatementTarget(node)) {
|
|
202543
202986
|
const label = getTargetLabel(node.parent, node.text);
|
|
@@ -202551,9 +202994,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202551
202994
|
)] : void 0;
|
|
202552
202995
|
}
|
|
202553
202996
|
switch (node.kind) {
|
|
202554
|
-
case 107:
|
|
202555
|
-
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
202556
|
-
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
202557
202997
|
case 90:
|
|
202558
202998
|
if (!isDefaultClause(node.parent)) {
|
|
202559
202999
|
break;
|
|
@@ -202566,19 +203006,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202566
203006
|
}
|
|
202567
203007
|
break;
|
|
202568
203008
|
}
|
|
202569
|
-
|
|
202570
|
-
|
|
202571
|
-
|
|
202572
|
-
|
|
202573
|
-
|
|
202574
|
-
|
|
202575
|
-
|
|
202576
|
-
|
|
202577
|
-
}
|
|
202578
|
-
if (node.kind === 127) {
|
|
202579
|
-
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
202580
|
-
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
|
|
202581
|
-
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
203009
|
+
let findFunctionDecl;
|
|
203010
|
+
switch (node.kind) {
|
|
203011
|
+
case 107:
|
|
203012
|
+
case 135:
|
|
203013
|
+
case 127:
|
|
203014
|
+
findFunctionDecl = isFunctionLikeDeclaration;
|
|
203015
|
+
const functionDeclaration = findAncestor(node, findFunctionDecl);
|
|
203016
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
202582
203017
|
}
|
|
202583
203018
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
202584
203019
|
const classDecl = node.parent.parent;
|
|
@@ -202628,6 +203063,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202628
203063
|
}];
|
|
202629
203064
|
}
|
|
202630
203065
|
}
|
|
203066
|
+
if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) {
|
|
203067
|
+
symbol = parent2.symbol;
|
|
203068
|
+
}
|
|
202631
203069
|
if (!symbol) {
|
|
202632
203070
|
return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker));
|
|
202633
203071
|
}
|
|
@@ -202824,12 +203262,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202824
203262
|
false
|
|
202825
203263
|
);
|
|
202826
203264
|
}
|
|
202827
|
-
|
|
203265
|
+
let { symbol, failedAliasResolution } = getSymbol(
|
|
202828
203266
|
node,
|
|
202829
203267
|
typeChecker,
|
|
202830
203268
|
/*stopAtAlias*/
|
|
202831
203269
|
false
|
|
202832
203270
|
);
|
|
203271
|
+
if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) {
|
|
203272
|
+
symbol = node.parent.symbol;
|
|
203273
|
+
failedAliasResolution = false;
|
|
203274
|
+
}
|
|
202833
203275
|
if (!symbol) return void 0;
|
|
202834
203276
|
const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
202835
203277
|
const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker);
|
|
@@ -203334,22 +203776,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203334
203776
|
if (!signature) {
|
|
203335
203777
|
return;
|
|
203336
203778
|
}
|
|
203337
|
-
|
|
203338
|
-
|
|
203339
|
-
if (
|
|
203340
|
-
|
|
203341
|
-
}
|
|
203342
|
-
const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(param);
|
|
203343
|
-
if (effectiveTypeAnnotation) {
|
|
203344
|
-
continue;
|
|
203779
|
+
let pos = 0;
|
|
203780
|
+
for (const param of node.parameters) {
|
|
203781
|
+
if (isHintableDeclaration(param)) {
|
|
203782
|
+
addParameterTypeHint(param, parameterIsThisKeyword(param) ? signature.thisParameter : signature.parameters[pos]);
|
|
203345
203783
|
}
|
|
203346
|
-
|
|
203347
|
-
if (!typeHints) {
|
|
203784
|
+
if (parameterIsThisKeyword(param)) {
|
|
203348
203785
|
continue;
|
|
203349
203786
|
}
|
|
203350
|
-
|
|
203787
|
+
pos++;
|
|
203351
203788
|
}
|
|
203352
203789
|
}
|
|
203790
|
+
function addParameterTypeHint(node, symbol) {
|
|
203791
|
+
const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(node);
|
|
203792
|
+
if (effectiveTypeAnnotation || symbol === void 0) return;
|
|
203793
|
+
const typeHints = getParameterDeclarationTypeHints(symbol);
|
|
203794
|
+
if (typeHints === void 0) return;
|
|
203795
|
+
addTypeHints(typeHints, node.questionToken ? node.questionToken.end : node.name.end);
|
|
203796
|
+
}
|
|
203353
203797
|
function getParameterDeclarationTypeHints(symbol) {
|
|
203354
203798
|
const valueDeclaration = symbol.valueDeclaration;
|
|
203355
203799
|
if (!valueDeclaration || !isParameter(valueDeclaration)) {
|
|
@@ -213221,6 +213665,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213221
213665
|
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
213222
213666
|
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
213223
213667
|
createProgram: () => createProgram,
|
|
213668
|
+
createProgramDiagnostics: () => createProgramDiagnostics,
|
|
213224
213669
|
createProgramHost: () => createProgramHost,
|
|
213225
213670
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
213226
213671
|
createQueue: () => createQueue,
|
|
@@ -213390,6 +213835,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213390
213835
|
forEachLeadingCommentRange: () => forEachLeadingCommentRange,
|
|
213391
213836
|
forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
|
|
213392
213837
|
forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
|
|
213838
|
+
forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
|
|
213839
|
+
forEachProjectReference: () => forEachProjectReference,
|
|
213393
213840
|
forEachPropertyAssignment: () => forEachPropertyAssignment,
|
|
213394
213841
|
forEachResolvedProjectReference: () => forEachResolvedProjectReference,
|
|
213395
213842
|
forEachReturnStatement: () => forEachReturnStatement,
|
|
@@ -213629,6 +214076,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213629
214076
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
213630
214077
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
213631
214078
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
214079
|
+
getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
|
|
214080
|
+
getLibNameFromLibReference: () => getLibNameFromLibReference,
|
|
213632
214081
|
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
213633
214082
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
213634
214083
|
getLineInfo: () => getLineInfo,
|
|
@@ -213701,6 +214150,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213701
214150
|
getOptionFromName: () => getOptionFromName,
|
|
213702
214151
|
getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
|
|
213703
214152
|
getOptionsNameMap: () => getOptionsNameMap,
|
|
214153
|
+
getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
|
|
214154
|
+
getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
|
|
213704
214155
|
getOrCreateEmitNode: () => getOrCreateEmitNode,
|
|
213705
214156
|
getOrUpdate: () => getOrUpdate,
|
|
213706
214157
|
getOriginalNode: () => getOriginalNode,
|
|
@@ -213737,7 +214188,6 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213737
214188
|
getPrivateIdentifier: () => getPrivateIdentifier,
|
|
213738
214189
|
getProperties: () => getProperties,
|
|
213739
214190
|
getProperty: () => getProperty,
|
|
213740
|
-
getPropertyArrayElementValue: () => getPropertyArrayElementValue,
|
|
213741
214191
|
getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
|
|
213742
214192
|
getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
|
|
213743
214193
|
getPropertyNameFromType: () => getPropertyNameFromType,
|
|
@@ -214648,6 +215098,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
214648
215098
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
214649
215099
|
moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
|
|
214650
215100
|
moduleSpecifiers: () => ts_moduleSpecifiers_exports,
|
|
215101
|
+
moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
|
|
214651
215102
|
moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
|
|
214652
215103
|
moveEmitHelpers: () => moveEmitHelpers,
|
|
214653
215104
|
moveRangeEnd: () => moveRangeEnd,
|
|
@@ -216012,6 +216463,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
216012
216463
|
ModuleKind3["ES2022"] = "es2022";
|
|
216013
216464
|
ModuleKind3["ESNext"] = "esnext";
|
|
216014
216465
|
ModuleKind3["Node16"] = "node16";
|
|
216466
|
+
ModuleKind3["Node18"] = "node18";
|
|
216015
216467
|
ModuleKind3["NodeNext"] = "nodenext";
|
|
216016
216468
|
ModuleKind3["Preserve"] = "preserve";
|
|
216017
216469
|
return ModuleKind3;
|
|
@@ -226438,20 +226890,19 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
226438
226890
|
try {
|
|
226439
226891
|
codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
|
|
226440
226892
|
} catch (e) {
|
|
226893
|
+
const error2 = e instanceof Error ? e : new Error(e);
|
|
226441
226894
|
const ls = project.getLanguageService();
|
|
226442
226895
|
const existingDiagCodes = [
|
|
226443
226896
|
...ls.getSyntacticDiagnostics(file),
|
|
226444
226897
|
...ls.getSemanticDiagnostics(file),
|
|
226445
226898
|
...ls.getSuggestionDiagnostics(file)
|
|
226446
|
-
].map(
|
|
226447
|
-
(d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code
|
|
226448
|
-
);
|
|
226899
|
+
].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code);
|
|
226449
226900
|
const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c));
|
|
226450
226901
|
if (badCode !== void 0) {
|
|
226451
|
-
|
|
226452
|
-
${
|
|
226902
|
+
error2.message += `
|
|
226903
|
+
Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
|
|
226453
226904
|
}
|
|
226454
|
-
throw
|
|
226905
|
+
throw error2;
|
|
226455
226906
|
}
|
|
226456
226907
|
return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
|
|
226457
226908
|
}
|
|
@@ -260921,13 +261372,13 @@ var require_git_raw_commits = __commonJS({
|
|
|
260921
261372
|
});
|
|
260922
261373
|
|
|
260923
261374
|
// node_modules/@commitlint/cli/lib/cli.js
|
|
260924
|
-
import { createRequire as createRequire4 } from "module";
|
|
260925
|
-
import path13 from "path";
|
|
260926
|
-
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL4 } from "url";
|
|
260927
|
-
import util2 from "util";
|
|
261375
|
+
import { createRequire as createRequire4 } from "node:module";
|
|
261376
|
+
import path13 from "node:path";
|
|
261377
|
+
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL4 } from "node:url";
|
|
261378
|
+
import util2 from "node:util";
|
|
260928
261379
|
|
|
260929
261380
|
// node_modules/@commitlint/lint/lib/lint.js
|
|
260930
|
-
import util from "util";
|
|
261381
|
+
import util from "node:util";
|
|
260931
261382
|
|
|
260932
261383
|
// node_modules/@commitlint/is-ignored/lib/defaults.js
|
|
260933
261384
|
var import_semver = __toESM(require_semver2(), 1);
|
|
@@ -260953,35 +261404,18 @@ var wildcards = [
|
|
|
260953
261404
|
test(/^Auto-merged (.*?) into (.*)/)
|
|
260954
261405
|
];
|
|
260955
261406
|
|
|
260956
|
-
// node_modules/@commitlint/is-ignored/lib/validate-ignore-func.js
|
|
260957
|
-
function validateIgnoreFunction(fn) {
|
|
260958
|
-
const fnString = fn.toString();
|
|
260959
|
-
const dangerousPattern = /(?:process|require|import|eval|fetch|XMLHttpRequest|fs|child_process)(?:\s*\.|\s*\()|(?:exec|execFile|spawn)\s*\(/;
|
|
260960
|
-
if (dangerousPattern.test(fnString)) {
|
|
260961
|
-
const match2 = fnString.match(dangerousPattern);
|
|
260962
|
-
throw new Error(`Ignore function contains forbidden pattern: ${match2?.[0].trim()}`);
|
|
260963
|
-
}
|
|
260964
|
-
}
|
|
260965
|
-
|
|
260966
261407
|
// node_modules/@commitlint/is-ignored/lib/is-ignored.js
|
|
260967
261408
|
function isIgnored(commit = "", opts = {}) {
|
|
260968
261409
|
const ignores = typeof opts.ignores === "undefined" ? [] : opts.ignores;
|
|
260969
261410
|
if (!Array.isArray(ignores)) {
|
|
260970
261411
|
throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
|
|
260971
261412
|
}
|
|
260972
|
-
ignores.forEach(validateIgnoreFunction);
|
|
260973
261413
|
const invalids = ignores.filter((c) => typeof c !== "function");
|
|
260974
261414
|
if (invalids.length > 0) {
|
|
260975
261415
|
throw new Error(`ignores must be array of type function, received items of type: ${invalids.map((i) => typeof i).join(", ")}`);
|
|
260976
261416
|
}
|
|
260977
261417
|
const base = opts.defaults === false ? [] : wildcards;
|
|
260978
|
-
return [...base, ...ignores].some((w) =>
|
|
260979
|
-
const result = w(commit);
|
|
260980
|
-
if (typeof result !== "boolean") {
|
|
260981
|
-
throw new Error(`Ignore function must return a boolean, received ${typeof result}`);
|
|
260982
|
-
}
|
|
260983
|
-
return result;
|
|
260984
|
-
});
|
|
261418
|
+
return [...base, ...ignores].some((w) => w(commit));
|
|
260985
261419
|
}
|
|
260986
261420
|
|
|
260987
261421
|
// node_modules/@commitlint/parse/lib/index.js
|
|
@@ -261534,7 +261968,7 @@ var subjectExclamationMark = (parsed, when = "always") => {
|
|
|
261534
261968
|
};
|
|
261535
261969
|
|
|
261536
261970
|
// node_modules/@commitlint/rules/lib/trailer-exists.js
|
|
261537
|
-
import { spawnSync } from "child_process";
|
|
261971
|
+
import { spawnSync } from "node:child_process";
|
|
261538
261972
|
var trailerExists = (parsed, when = "always", value2 = "") => {
|
|
261539
261973
|
const trailers = spawnSync("git", ["interpret-trailers", "--parse"], {
|
|
261540
261974
|
input: parsed.raw || ""
|
|
@@ -261791,11 +262225,11 @@ async function lint(message2, rawRulesConfig, rawOpts) {
|
|
|
261791
262225
|
}
|
|
261792
262226
|
|
|
261793
262227
|
// node_modules/@commitlint/load/lib/load.js
|
|
261794
|
-
import path8 from "path";
|
|
262228
|
+
import path8 from "node:path";
|
|
261795
262229
|
|
|
261796
262230
|
// node_modules/@commitlint/config-validator/lib/validate.js
|
|
261797
262231
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
261798
|
-
import { createRequire } from "module";
|
|
262232
|
+
import { createRequire } from "node:module";
|
|
261799
262233
|
|
|
261800
262234
|
// node_modules/@commitlint/config-validator/lib/formatErrors.js
|
|
261801
262235
|
function formatErrors(errors) {
|
|
@@ -261872,9 +262306,9 @@ function executable(config) {
|
|
|
261872
262306
|
}
|
|
261873
262307
|
|
|
261874
262308
|
// node_modules/@commitlint/resolve-extends/lib/index.js
|
|
261875
|
-
import fs3 from "fs";
|
|
261876
|
-
import path4 from "path";
|
|
261877
|
-
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath4 } from "url";
|
|
262309
|
+
import fs3 from "node:fs";
|
|
262310
|
+
import path4 from "node:path";
|
|
262311
|
+
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath4 } from "node:url";
|
|
261878
262312
|
|
|
261879
262313
|
// node_modules/global-directory/index.js
|
|
261880
262314
|
var import_ini = __toESM(require_ini(), 1);
|
|
@@ -263353,8 +263787,8 @@ var import_lodash9 = __toESM(require_lodash9(), 1);
|
|
|
263353
263787
|
|
|
263354
263788
|
// node_modules/@commitlint/load/lib/utils/load-config.js
|
|
263355
263789
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
263356
|
-
import { existsSync, readFileSync } from "fs";
|
|
263357
|
-
import path5 from "path";
|
|
263790
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
263791
|
+
import path5 from "node:path";
|
|
263358
263792
|
|
|
263359
263793
|
// node_modules/jiti/lib/jiti.mjs
|
|
263360
263794
|
var import_jiti = __toESM(require_jiti(), 1);
|
|
@@ -263519,9 +263953,9 @@ async function loadParserOpts(pendingParser) {
|
|
|
263519
263953
|
}
|
|
263520
263954
|
|
|
263521
263955
|
// node_modules/@commitlint/load/lib/utils/load-plugin.js
|
|
263522
|
-
import { createRequire as createRequire3 } from "module";
|
|
263523
|
-
import path7 from "path";
|
|
263524
|
-
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
263956
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
263957
|
+
import path7 from "node:path";
|
|
263958
|
+
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "node:url";
|
|
263525
263959
|
|
|
263526
263960
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
263527
263961
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -264013,7 +264447,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
264013
264447
|
var source_default = chalk;
|
|
264014
264448
|
|
|
264015
264449
|
// node_modules/@commitlint/load/lib/utils/plugin-naming.js
|
|
264016
|
-
import path6 from "path";
|
|
264450
|
+
import path6 from "node:path";
|
|
264017
264451
|
var prefix = "commitlint-plugin";
|
|
264018
264452
|
function convertPathToPosix(filepath) {
|
|
264019
264453
|
const normalizedFilepath = path6.normalize(filepath);
|
|
@@ -264211,7 +264645,7 @@ async function getHistoryCommits(options, opts = {}) {
|
|
|
264211
264645
|
}
|
|
264212
264646
|
|
|
264213
264647
|
// node_modules/@commitlint/top-level/lib/index.js
|
|
264214
|
-
import path11 from "path";
|
|
264648
|
+
import path11 from "node:path";
|
|
264215
264649
|
|
|
264216
264650
|
// node_modules/find-up/index.js
|
|
264217
264651
|
import path10 from "node:path";
|
|
@@ -264278,6 +264712,12 @@ var Queue = class {
|
|
|
264278
264712
|
current = current.next;
|
|
264279
264713
|
}
|
|
264280
264714
|
}
|
|
264715
|
+
*drain() {
|
|
264716
|
+
let current;
|
|
264717
|
+
while ((current = this.dequeue()) !== void 0) {
|
|
264718
|
+
yield current;
|
|
264719
|
+
}
|
|
264720
|
+
}
|
|
264281
264721
|
};
|
|
264282
264722
|
|
|
264283
264723
|
// node_modules/p-locate/node_modules/p-limit/index.js
|
|
@@ -264460,7 +264900,7 @@ async function searchDotGit(cwd) {
|
|
|
264460
264900
|
import fs6 from "fs/promises";
|
|
264461
264901
|
|
|
264462
264902
|
// node_modules/@commitlint/read/lib/get-edit-file-path.js
|
|
264463
|
-
import path12 from "path";
|
|
264903
|
+
import path12 from "node:path";
|
|
264464
264904
|
import fs5 from "fs/promises";
|
|
264465
264905
|
async function getEditFilePath(top2, edit) {
|
|
264466
264906
|
if (typeof edit === "string") {
|