typescript 4.7.0-dev.20220501 → 4.7.0-dev.20220504
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/AUTHORS.md +1 -0
- package/lib/cs/diagnosticMessages.generated.json +2 -2
- package/lib/de/diagnosticMessages.generated.json +2 -2
- package/lib/es/diagnosticMessages.generated.json +2 -2
- package/lib/fr/diagnosticMessages.generated.json +2 -2
- package/lib/it/diagnosticMessages.generated.json +2 -2
- package/lib/ja/diagnosticMessages.generated.json +2 -2
- package/lib/ko/diagnosticMessages.generated.json +2 -2
- package/lib/lib.es2020.bigint.d.ts +4 -4
- package/lib/lib.es5.d.ts +12 -12
- package/lib/pl/diagnosticMessages.generated.json +2 -2
- package/lib/pt-br/diagnosticMessages.generated.json +2 -2
- package/lib/ru/diagnosticMessages.generated.json +2 -2
- package/lib/tr/diagnosticMessages.generated.json +2 -2
- package/lib/tsc.js +94 -75
- package/lib/tsserver.js +146 -113
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +146 -113
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +135 -104
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +135 -104
- package/lib/typingsInstaller.js +110 -86
- package/lib/zh-cn/diagnosticMessages.generated.json +2 -2
- package/lib/zh-tw/diagnosticMessages.generated.json +2 -2
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220504";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -5265,10 +5265,11 @@ var ts;
|
|
|
5265
5265
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
5266
5266
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
5267
5267
|
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
|
|
5268
|
-
// to better support ecmascript modules and their use within node - more features are still being added
|
|
5269
|
-
//
|
|
5270
|
-
// version-
|
|
5271
|
-
|
|
5268
|
+
// to better support ecmascript modules and their use within node - however more features are still being added.
|
|
5269
|
+
// TypeScript's Node ESM support was introduced after Node 12 went end-of-life, and Node 14 is the earliest stable
|
|
5270
|
+
// version that supports both pattern trailers - *but*, Node 16 is the first version that also supports ECMASCript 2022.
|
|
5271
|
+
// In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target
|
|
5272
|
+
ModuleResolutionKind[ModuleResolutionKind["Node16"] = 3] = "Node16";
|
|
5272
5273
|
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
5273
5274
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
5274
5275
|
var ModuleDetectionKind;
|
|
@@ -5278,7 +5279,7 @@ var ts;
|
|
|
5278
5279
|
*/
|
|
5279
5280
|
ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
|
|
5280
5281
|
/**
|
|
5281
|
-
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution:
|
|
5282
|
+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
|
|
5282
5283
|
*/
|
|
5283
5284
|
ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
|
|
5284
5285
|
/**
|
|
@@ -5323,8 +5324,8 @@ var ts;
|
|
|
5323
5324
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
5324
5325
|
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
|
|
5325
5326
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
5326
|
-
//
|
|
5327
|
-
ModuleKind[ModuleKind["
|
|
5327
|
+
// Node16+ is an amalgam of commonjs (albeit updated) and es2022+, and represents a distinct module system from es2020/esnext
|
|
5328
|
+
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
5328
5329
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
5329
5330
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
5330
5331
|
var JsxEmit;
|
|
@@ -8246,6 +8247,7 @@ var ts;
|
|
|
8246
8247
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
8247
8248
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
8248
8249
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "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."),
|
|
8250
|
+
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "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."),
|
|
8249
8251
|
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
8250
8252
|
The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
|
|
8251
8253
|
Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
|
|
@@ -8257,8 +8259,8 @@ var ts;
|
|
|
8257
8259
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "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."),
|
|
8258
8260
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, "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."),
|
|
8259
8261
|
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, ts.DiagnosticCategory.Error, "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."),
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "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', or 'nodenext'."),
|
|
8263
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),
|
|
8262
8264
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
8263
8265
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "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."),
|
|
8264
8266
|
String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -8275,7 +8277,7 @@ var ts;
|
|
|
8275
8277
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
8276
8278
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
8277
8279
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
8278
|
-
|
|
8280
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
|
|
8279
8281
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
8280
8282
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
8281
8283
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -8306,7 +8308,7 @@ var ts;
|
|
|
8306
8308
|
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, ts.DiagnosticCategory.Error, "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."),
|
|
8307
8309
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
8308
8310
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
8309
|
-
|
|
8311
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, "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', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
8310
8312
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, "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'."),
|
|
8311
8313
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.Error, "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'."),
|
|
8312
8314
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -8358,7 +8360,7 @@ var ts;
|
|
|
8358
8360
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
8359
8361
|
The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
8360
8362
|
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, ts.DiagnosticCategory.Error, "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."),
|
|
8361
|
-
|
|
8363
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, "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', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
8362
8364
|
Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
|
|
8363
8365
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
8364
8366
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -8376,7 +8378,7 @@ var ts;
|
|
|
8376
8378
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
8377
8379
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
8378
8380
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
8379
|
-
|
|
8381
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
8380
8382
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
8381
8383
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
8382
8384
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -8387,7 +8389,7 @@ var ts;
|
|
|
8387
8389
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
8388
8390
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
8389
8391
|
Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
|
|
8390
|
-
|
|
8392
|
+
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules."),
|
|
8391
8393
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8392
8394
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8393
8395
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -8396,7 +8398,6 @@ var ts;
|
|
|
8396
8398
|
Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
8397
8399
|
The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
|
|
8398
8400
|
The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
|
|
8399
|
-
This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
|
|
8400
8401
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
8401
8402
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
8402
8403
|
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -8874,8 +8875,8 @@ var ts;
|
|
|
8874
8875
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
8875
8876
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8876
8877
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8877
|
-
|
|
8878
|
-
|
|
8878
|
+
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, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
8879
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
8879
8880
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
8880
8881
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8881
8882
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
@@ -9541,7 +9542,6 @@ var ts;
|
|
|
9541
9542
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
|
|
9542
9543
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
|
|
9543
9544
|
A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
|
|
9544
|
-
JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
|
|
9545
9545
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
9546
9546
|
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
|
|
9547
9547
|
import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
|
|
@@ -14834,7 +14834,7 @@ var ts;
|
|
|
14834
14834
|
}
|
|
14835
14835
|
ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
|
|
14836
14836
|
function isCommonJSContainingModuleKind(kind) {
|
|
14837
|
-
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.
|
|
14837
|
+
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node16 || kind === ts.ModuleKind.NodeNext;
|
|
14838
14838
|
}
|
|
14839
14839
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
14840
14840
|
return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
|
|
@@ -20002,7 +20002,7 @@ var ts;
|
|
|
20002
20002
|
file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
|
|
20003
20003
|
};
|
|
20004
20004
|
case ts.ModuleDetectionKind.Auto:
|
|
20005
|
-
// If module is nodenext or
|
|
20005
|
+
// If module is nodenext or node16, all esm format files are modules
|
|
20006
20006
|
// If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
|
|
20007
20007
|
// otherwise, the presence of import or export statments (or import.meta) implies module-ness
|
|
20008
20008
|
var checks = [ts.isFileProbablyExternalModule];
|
|
@@ -20010,7 +20010,7 @@ var ts;
|
|
|
20010
20010
|
checks.push(isFileModuleFromUsingJSXTag);
|
|
20011
20011
|
}
|
|
20012
20012
|
var moduleKind = getEmitModuleKind(options);
|
|
20013
|
-
if (moduleKind === ts.ModuleKind.
|
|
20013
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
20014
20014
|
checks.push(isFileForcedToBeModuleByFormat);
|
|
20015
20015
|
}
|
|
20016
20016
|
var combined_1 = ts.or.apply(void 0, checks);
|
|
@@ -20021,7 +20021,7 @@ var ts;
|
|
|
20021
20021
|
ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
|
|
20022
20022
|
function getEmitScriptTarget(compilerOptions) {
|
|
20023
20023
|
return compilerOptions.target ||
|
|
20024
|
-
(compilerOptions.module === ts.ModuleKind.
|
|
20024
|
+
(compilerOptions.module === ts.ModuleKind.Node16 && 9 /* ES2022 */) ||
|
|
20025
20025
|
(compilerOptions.module === ts.ModuleKind.NodeNext && 99 /* ESNext */) ||
|
|
20026
20026
|
0 /* ES3 */;
|
|
20027
20027
|
}
|
|
@@ -20039,8 +20039,8 @@ var ts;
|
|
|
20039
20039
|
case ts.ModuleKind.CommonJS:
|
|
20040
20040
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
20041
20041
|
break;
|
|
20042
|
-
case ts.ModuleKind.
|
|
20043
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
20042
|
+
case ts.ModuleKind.Node16:
|
|
20043
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
20044
20044
|
break;
|
|
20045
20045
|
case ts.ModuleKind.NodeNext:
|
|
20046
20046
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -20065,7 +20065,7 @@ var ts;
|
|
|
20065
20065
|
case ts.ModuleKind.ES2020:
|
|
20066
20066
|
case ts.ModuleKind.ES2022:
|
|
20067
20067
|
case ts.ModuleKind.ESNext:
|
|
20068
|
-
case ts.ModuleKind.
|
|
20068
|
+
case ts.ModuleKind.Node16:
|
|
20069
20069
|
case ts.ModuleKind.NodeNext:
|
|
20070
20070
|
return true;
|
|
20071
20071
|
default:
|
|
@@ -20090,7 +20090,7 @@ var ts;
|
|
|
20090
20090
|
return compilerOptions.esModuleInterop;
|
|
20091
20091
|
}
|
|
20092
20092
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
20093
|
-
case ts.ModuleKind.
|
|
20093
|
+
case ts.ModuleKind.Node16:
|
|
20094
20094
|
case ts.ModuleKind.NodeNext:
|
|
20095
20095
|
return true;
|
|
20096
20096
|
}
|
|
@@ -39296,7 +39296,7 @@ var ts;
|
|
|
39296
39296
|
es2020: ts.ModuleKind.ES2020,
|
|
39297
39297
|
es2022: ts.ModuleKind.ES2022,
|
|
39298
39298
|
esnext: ts.ModuleKind.ESNext,
|
|
39299
|
-
|
|
39299
|
+
node16: ts.ModuleKind.Node16,
|
|
39300
39300
|
nodenext: ts.ModuleKind.NodeNext,
|
|
39301
39301
|
})),
|
|
39302
39302
|
affectsModuleResolution: true,
|
|
@@ -39650,7 +39650,7 @@ var ts;
|
|
|
39650
39650
|
type: new ts.Map(ts.getEntries({
|
|
39651
39651
|
node: ts.ModuleResolutionKind.NodeJs,
|
|
39652
39652
|
classic: ts.ModuleResolutionKind.Classic,
|
|
39653
|
-
|
|
39653
|
+
node16: ts.ModuleResolutionKind.Node16,
|
|
39654
39654
|
nodenext: ts.ModuleResolutionKind.NodeNext,
|
|
39655
39655
|
})),
|
|
39656
39656
|
affectsModuleResolution: true,
|
|
@@ -40126,7 +40126,7 @@ var ts;
|
|
|
40126
40126
|
affectsModuleResolution: true,
|
|
40127
40127
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
40128
40128
|
category: ts.Diagnostics.Language_and_Environment,
|
|
40129
|
-
defaultValueDescription: ts.Diagnostics.
|
|
40129
|
+
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
40130
40130
|
}
|
|
40131
40131
|
];
|
|
40132
40132
|
/* @internal */
|
|
@@ -42362,9 +42362,9 @@ var ts;
|
|
|
42362
42362
|
// set in a non-modal module resolution setting here. Do note that our behavior is not particularly well defined when these mode-overriding imports
|
|
42363
42363
|
// are present in a non-modal project; while in theory we'd like to either ignore the mode or provide faithful modern resolution, depending on what we feel is best,
|
|
42364
42364
|
// in practice, not every cache has the options available to intelligently make the choice to ignore the mode request, and it's unclear how modern "faithful modern
|
|
42365
|
-
// resolution" should be (`
|
|
42365
|
+
// resolution" should be (`node16`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution
|
|
42366
42366
|
// context should _probably_ be an error - and that should likely be handled by the `Program` (which is what we do).
|
|
42367
|
-
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42367
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
42368
42368
|
features |= NodeResolutionFeatures.EsmMode;
|
|
42369
42369
|
}
|
|
42370
42370
|
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
@@ -42453,7 +42453,7 @@ var ts;
|
|
|
42453
42453
|
}
|
|
42454
42454
|
ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
42455
42455
|
function getDefaultNodeResolutionFeatures(options) {
|
|
42456
|
-
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42456
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
|
|
42457
42457
|
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
42458
42458
|
NodeResolutionFeatures.None;
|
|
42459
42459
|
}
|
|
@@ -42811,8 +42811,8 @@ var ts;
|
|
|
42811
42811
|
case ts.ModuleKind.CommonJS:
|
|
42812
42812
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
42813
42813
|
break;
|
|
42814
|
-
case ts.ModuleKind.
|
|
42815
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
42814
|
+
case ts.ModuleKind.Node16:
|
|
42815
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
42816
42816
|
break;
|
|
42817
42817
|
case ts.ModuleKind.NodeNext:
|
|
42818
42818
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -42832,8 +42832,8 @@ var ts;
|
|
|
42832
42832
|
}
|
|
42833
42833
|
ts.perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
|
|
42834
42834
|
switch (moduleResolution) {
|
|
42835
|
-
case ts.ModuleResolutionKind.
|
|
42836
|
-
result =
|
|
42835
|
+
case ts.ModuleResolutionKind.Node16:
|
|
42836
|
+
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42837
42837
|
break;
|
|
42838
42838
|
case ts.ModuleResolutionKind.NodeNext:
|
|
42839
42839
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43067,15 +43067,15 @@ var ts;
|
|
|
43067
43067
|
// respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names
|
|
43068
43068
|
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
43069
43069
|
// allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"`
|
|
43070
|
-
// not
|
|
43070
|
+
// not supported in node 12 - https://github.com/nodejs/Release/issues/690
|
|
43071
43071
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
43072
43072
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
43073
|
-
NodeResolutionFeatures[NodeResolutionFeatures["
|
|
43073
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node16Default"] = 30] = "Node16Default";
|
|
43074
43074
|
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
43075
43075
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
43076
43076
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
43077
|
-
function
|
|
43078
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
43077
|
+
function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43078
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
43079
43079
|
}
|
|
43080
43080
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43081
43081
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43115,7 +43115,7 @@ var ts;
|
|
|
43115
43115
|
var _a, _b;
|
|
43116
43116
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
43117
43117
|
var failedLookupLocations = [];
|
|
43118
|
-
// conditions are only used by the
|
|
43118
|
+
// conditions are only used by the node16/nodenext resolver - there's no priority order in the list,
|
|
43119
43119
|
//it's essentially a set (priority is determined by object insertion order in the object we look at).
|
|
43120
43120
|
var conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
|
|
43121
43121
|
if (compilerOptions.noDtsResolution) {
|
|
@@ -48502,7 +48502,7 @@ var ts;
|
|
|
48502
48502
|
var enumRelation = new ts.Map();
|
|
48503
48503
|
var builtinGlobals = ts.createSymbolTable();
|
|
48504
48504
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
48505
|
-
// Extensions suggested for path imports when module resolution is
|
|
48505
|
+
// Extensions suggested for path imports when module resolution is node16 or higher.
|
|
48506
48506
|
// The first element of each tuple is the extension a file has.
|
|
48507
48507
|
// The second element of each tuple is the extension that should be used in a path import.
|
|
48508
48508
|
// e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
|
|
@@ -50791,7 +50791,7 @@ var ts;
|
|
|
50791
50791
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
50792
50792
|
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
|
|
50793
50793
|
}
|
|
50794
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
50794
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
50795
50795
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
50796
50796
|
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
50797
50797
|
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
@@ -50800,9 +50800,6 @@ var ts;
|
|
|
50800
50800
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
50801
50801
|
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
|
|
50802
50802
|
}
|
|
50803
|
-
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
50804
|
-
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
50805
|
-
}
|
|
50806
50803
|
}
|
|
50807
50804
|
// merged symbol is module declaration symbol combined with all augmentations
|
|
50808
50805
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -50855,7 +50852,7 @@ var ts;
|
|
|
50855
50852
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
50856
50853
|
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
50857
50854
|
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
50858
|
-
var
|
|
50855
|
+
var resolutionIsNode16OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node16 ||
|
|
50859
50856
|
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
50860
50857
|
if (tsExtension) {
|
|
50861
50858
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
@@ -50876,17 +50873,17 @@ var ts;
|
|
|
50876
50873
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
50877
50874
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
50878
50875
|
}
|
|
50879
|
-
else if (mode === ts.ModuleKind.ESNext &&
|
|
50876
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
50880
50877
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
50881
50878
|
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
50882
50879
|
var actualExt = _a[0], _importExt = _a[1];
|
|
50883
50880
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
50884
50881
|
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
50885
50882
|
if (suggestedExt) {
|
|
50886
|
-
error(errorNode, ts.Diagnostics.
|
|
50883
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
50887
50884
|
}
|
|
50888
50885
|
else {
|
|
50889
|
-
error(errorNode, ts.Diagnostics.
|
|
50886
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
50890
50887
|
}
|
|
50891
50888
|
}
|
|
50892
50889
|
else {
|
|
@@ -53208,7 +53205,7 @@ var ts;
|
|
|
53208
53205
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
53209
53206
|
var specifier = void 0;
|
|
53210
53207
|
var assertion = void 0;
|
|
53211
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53208
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53212
53209
|
// An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion
|
|
53213
53210
|
if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53214
53211
|
specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
|
|
@@ -53222,7 +53219,7 @@ var ts;
|
|
|
53222
53219
|
}
|
|
53223
53220
|
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
53224
53221
|
var oldSpecifier = specifier;
|
|
53225
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53222
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53226
53223
|
// We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set
|
|
53227
53224
|
var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
53228
53225
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
@@ -64699,7 +64696,6 @@ var ts;
|
|
|
64699
64696
|
return 0 /* False */;
|
|
64700
64697
|
}
|
|
64701
64698
|
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
64702
|
-
var _a, _b;
|
|
64703
64699
|
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
64704
64700
|
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
64705
64701
|
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
@@ -64740,9 +64736,6 @@ var ts;
|
|
|
64740
64736
|
return;
|
|
64741
64737
|
}
|
|
64742
64738
|
reportRelationError(headMessage, source, target);
|
|
64743
|
-
if (strictNullChecks && source.flags & 8650752 /* TypeVariable */ && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) {
|
|
64744
|
-
associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
|
|
64745
|
-
}
|
|
64746
64739
|
}
|
|
64747
64740
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
64748
64741
|
if (!ts.tracing) {
|
|
@@ -65515,7 +65508,7 @@ var ts;
|
|
|
65515
65508
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
65516
65509
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
65517
65510
|
var constraint = getConstraintOfType(source);
|
|
65518
|
-
if (!
|
|
65511
|
+
if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
|
|
65519
65512
|
// A type variable with no constraint is not related to the non-primitive object type.
|
|
65520
65513
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
|
|
65521
65514
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -65523,12 +65516,12 @@ var ts;
|
|
|
65523
65516
|
}
|
|
65524
65517
|
}
|
|
65525
65518
|
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
|
|
65526
|
-
else if (
|
|
65519
|
+
else if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
65527
65520
|
resetErrorInfo(saveErrorInfo);
|
|
65528
65521
|
return result;
|
|
65529
65522
|
}
|
|
65530
65523
|
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
|
|
65531
|
-
else if (
|
|
65524
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
65532
65525
|
resetErrorInfo(saveErrorInfo);
|
|
65533
65526
|
return result;
|
|
65534
65527
|
}
|
|
@@ -71191,7 +71184,7 @@ var ts;
|
|
|
71191
71184
|
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
71192
71185
|
var parent = declaration.parent.parent;
|
|
71193
71186
|
if (parent.kind === 254 /* VariableDeclaration */ && ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 164 /* Parameter */) {
|
|
71194
|
-
var links = getNodeLinks(
|
|
71187
|
+
var links = getNodeLinks(parent);
|
|
71195
71188
|
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
|
|
71196
71189
|
links.flags |= 268435456 /* InCheckIdentifier */;
|
|
71197
71190
|
var parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
@@ -77054,13 +77047,13 @@ var ts;
|
|
|
77054
77047
|
}
|
|
77055
77048
|
}
|
|
77056
77049
|
function checkImportMetaProperty(node) {
|
|
77057
|
-
if (moduleKind === ts.ModuleKind.
|
|
77050
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
77058
77051
|
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
77059
77052
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
77060
77053
|
}
|
|
77061
77054
|
}
|
|
77062
77055
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
77063
|
-
error(node, ts.Diagnostics.
|
|
77056
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
77064
77057
|
}
|
|
77065
77058
|
var file = ts.getSourceFileOfNode(node);
|
|
77066
77059
|
ts.Debug.assert(!!(file.flags & 4194304 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag.");
|
|
@@ -78011,15 +78004,30 @@ var ts;
|
|
|
78011
78004
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
78012
78005
|
var span = void 0;
|
|
78013
78006
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
78014
|
-
|
|
78015
|
-
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
78007
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78016
78008
|
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);
|
|
78017
78009
|
diagnostics.add(diagnostic);
|
|
78018
78010
|
}
|
|
78019
|
-
|
|
78020
|
-
|
|
78021
|
-
|
|
78022
|
-
|
|
78011
|
+
switch (moduleKind) {
|
|
78012
|
+
case ts.ModuleKind.Node16:
|
|
78013
|
+
case ts.ModuleKind.NodeNext:
|
|
78014
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
78015
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78016
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
78017
|
+
break;
|
|
78018
|
+
}
|
|
78019
|
+
// fallthrough
|
|
78020
|
+
case ts.ModuleKind.ES2022:
|
|
78021
|
+
case ts.ModuleKind.ESNext:
|
|
78022
|
+
case ts.ModuleKind.System:
|
|
78023
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
78024
|
+
break;
|
|
78025
|
+
}
|
|
78026
|
+
// fallthrough
|
|
78027
|
+
default:
|
|
78028
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78029
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
|
|
78030
|
+
break;
|
|
78023
78031
|
}
|
|
78024
78032
|
}
|
|
78025
78033
|
}
|
|
@@ -80461,8 +80469,8 @@ var ts;
|
|
|
80461
80469
|
if (node.assertions) {
|
|
80462
80470
|
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
80463
80471
|
if (override) {
|
|
80464
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
80465
|
-
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.
|
|
80472
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
80473
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80466
80474
|
}
|
|
80467
80475
|
}
|
|
80468
80476
|
}
|
|
@@ -81912,7 +81920,7 @@ var ts;
|
|
|
81912
81920
|
}
|
|
81913
81921
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
81914
81922
|
// No need to check for require or exports for ES6 modules and later
|
|
81915
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.
|
|
81923
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
81916
81924
|
return;
|
|
81917
81925
|
}
|
|
81918
81926
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -84832,8 +84840,8 @@ var ts;
|
|
|
84832
84840
|
var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84833
84841
|
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
84834
84842
|
if (validForTypeAssertions && override) {
|
|
84835
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
84836
|
-
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
84843
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
84844
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84837
84845
|
}
|
|
84838
84846
|
return; // Other grammar checks do not apply to type-only imports with resolution mode assertions
|
|
84839
84847
|
}
|
|
@@ -88020,8 +88028,24 @@ var ts;
|
|
|
88020
88028
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
88021
88029
|
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.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));
|
|
88022
88030
|
}
|
|
88023
|
-
|
|
88024
|
-
|
|
88031
|
+
switch (moduleKind) {
|
|
88032
|
+
case ts.ModuleKind.Node16:
|
|
88033
|
+
case ts.ModuleKind.NodeNext:
|
|
88034
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
88035
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
88036
|
+
break;
|
|
88037
|
+
}
|
|
88038
|
+
// fallthrough
|
|
88039
|
+
case ts.ModuleKind.ES2022:
|
|
88040
|
+
case ts.ModuleKind.ESNext:
|
|
88041
|
+
case ts.ModuleKind.System:
|
|
88042
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
88043
|
+
break;
|
|
88044
|
+
}
|
|
88045
|
+
// fallthrough
|
|
88046
|
+
default:
|
|
88047
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
|
|
88048
|
+
break;
|
|
88025
88049
|
}
|
|
88026
88050
|
}
|
|
88027
88051
|
}
|
|
@@ -88716,7 +88740,7 @@ var ts;
|
|
|
88716
88740
|
}
|
|
88717
88741
|
function checkGrammarImportCallExpression(node) {
|
|
88718
88742
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
88719
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
88743
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
|
|
88720
88744
|
}
|
|
88721
88745
|
if (node.typeArguments) {
|
|
88722
88746
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
@@ -88727,7 +88751,7 @@ var ts;
|
|
|
88727
88751
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88728
88752
|
if (nodeArguments.length > 1) {
|
|
88729
88753
|
var assertionArgument = nodeArguments[1];
|
|
88730
|
-
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.
|
|
88754
|
+
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88731
88755
|
}
|
|
88732
88756
|
}
|
|
88733
88757
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -108993,7 +109017,7 @@ var ts;
|
|
|
108993
109017
|
return ts.transformECMAScriptModule;
|
|
108994
109018
|
case ts.ModuleKind.System:
|
|
108995
109019
|
return ts.transformSystemModule;
|
|
108996
|
-
case ts.ModuleKind.
|
|
109020
|
+
case ts.ModuleKind.Node16:
|
|
108997
109021
|
case ts.ModuleKind.NodeNext:
|
|
108998
109022
|
return ts.transformNodeModule;
|
|
108999
109023
|
default:
|
|
@@ -116016,7 +116040,7 @@ var ts;
|
|
|
116016
116040
|
*/
|
|
116017
116041
|
function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
|
|
116018
116042
|
switch (ts.getEmitModuleResolutionKind(options)) {
|
|
116019
|
-
case ts.ModuleResolutionKind.
|
|
116043
|
+
case ts.ModuleResolutionKind.Node16:
|
|
116020
116044
|
case ts.ModuleResolutionKind.NodeNext:
|
|
116021
116045
|
return ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? ts.ModuleKind.ESNext :
|
|
116022
116046
|
ts.fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? ts.ModuleKind.CommonJS :
|
|
@@ -116315,7 +116339,7 @@ var ts;
|
|
|
116315
116339
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
116316
116340
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
116317
116341
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
116318
|
-
// under
|
|
116342
|
+
// under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode
|
|
116319
116343
|
processTypeReferenceDirective(typeReferences[i], /*mode*/ undefined, resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
116320
116344
|
}
|
|
116321
116345
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -117968,8 +117992,8 @@ var ts;
|
|
|
117968
117992
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
117969
117993
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
117970
117994
|
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117971
|
-
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
117972
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.
|
|
117995
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
117996
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
|
|
117973
117997
|
}
|
|
117974
117998
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
117975
117999
|
}
|
|
@@ -118331,7 +118355,7 @@ var ts;
|
|
|
118331
118355
|
}
|
|
118332
118356
|
if (options.resolveJsonModule) {
|
|
118333
118357
|
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
118334
|
-
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
118358
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 &&
|
|
118335
118359
|
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
118336
118360
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
118337
118361
|
}
|
|
@@ -121471,7 +121495,7 @@ var ts;
|
|
|
121471
121495
|
}
|
|
121472
121496
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
121473
121497
|
var _a;
|
|
121474
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
121498
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16
|
|
121475
121499
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
121476
121500
|
return false;
|
|
121477
121501
|
}
|
|
@@ -122056,7 +122080,7 @@ var ts;
|
|
|
122056
122080
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
122057
122081
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
122058
122082
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
122059
|
-
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
122083
|
+
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
122060
122084
|
// `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
|
|
122061
122085
|
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
|
122062
122086
|
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|