mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'main' into fix46934
This commit is contained in:
Generated
+11
-19
@@ -676,9 +676,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz",
|
||||
"integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==",
|
||||
"version": "16.11.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.11.tgz",
|
||||
"integrity": "sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node-fetch": {
|
||||
@@ -1864,10 +1864,14 @@
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.0.tgz",
|
||||
"integrity": "sha512-/duVOqst+luxCQRKEo4bNxinsOQtMP80ZYm7mMqzuh5PociNL0PvmHFvREJ9ueYL2TxlHjBcmLCdmocx9Vg+IQ==",
|
||||
"dev": true
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"check-error": {
|
||||
"version": "1.0.2",
|
||||
@@ -5104,18 +5108,6 @@
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"is-unicode-supported": "^0.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@
|
||||
"browser-resolve": "^1.11.2",
|
||||
"browserify": "latest",
|
||||
"chai": "latest",
|
||||
"chalk": "latest",
|
||||
"chalk": "^4.1.2",
|
||||
"convert-source-map": "latest",
|
||||
"del": "5.1.0",
|
||||
"diff": "^4.0.2",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @ts-check
|
||||
const chalk = require("chalk");
|
||||
const { join } = require("path");
|
||||
const { readFileSync } = require("fs");
|
||||
try {
|
||||
@@ -17,7 +18,6 @@ const playwright = require("playwright");
|
||||
const debugging = false;
|
||||
|
||||
(async () => {
|
||||
const chalk = (await import("chalk")).default;
|
||||
for (const browserType of ["chromium", "firefox"]) {
|
||||
const browser = await playwright[browserType].launch({ headless: !debugging });
|
||||
const context = await browser.newContext();
|
||||
|
||||
@@ -8,6 +8,7 @@ const mkdirp = require("mkdirp");
|
||||
const del = require("del");
|
||||
const File = require("vinyl");
|
||||
const ts = require("../../lib/typescript");
|
||||
const chalk = require("chalk");
|
||||
const which = require("which");
|
||||
const { spawn } = require("child_process");
|
||||
const { CancellationToken, CancelError, Deferred } = require("prex");
|
||||
@@ -26,7 +27,6 @@ const { Readable, Duplex } = require("stream");
|
||||
* @property {boolean} [waitForExit=true]
|
||||
*/
|
||||
async function exec(cmd, args, options = {}) {
|
||||
const chalk = (await import("chalk")).default;
|
||||
return /**@type {Promise<{exitCode: number}>}*/(new Promise((resolve, reject) => {
|
||||
const { ignoreExitCode, cancelToken = CancellationToken.none, waitForExit = true } = options;
|
||||
cancelToken.throwIfCancellationRequested();
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
namespace ts {
|
||||
/* @internal */
|
||||
export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
|
||||
export const compileOnSaveCommandLineOption: CommandLineOption = {
|
||||
name: "compileOnSave",
|
||||
type: "boolean",
|
||||
defaultValueDescription: false,
|
||||
};
|
||||
|
||||
const jsxOptionMap = new Map(getEntries({
|
||||
"preserve": JsxEmit.Preserve,
|
||||
@@ -117,6 +121,7 @@ namespace ts {
|
||||
})),
|
||||
category: Diagnostics.Watch_and_Build_Modes,
|
||||
description: Diagnostics.Specify_how_the_TypeScript_watch_mode_works,
|
||||
defaultValueDescription: WatchFileKind.UseFsEvents,
|
||||
},
|
||||
{
|
||||
name: "watchDirectory",
|
||||
@@ -128,6 +133,7 @@ namespace ts {
|
||||
})),
|
||||
category: Diagnostics.Watch_and_Build_Modes,
|
||||
description: Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
|
||||
defaultValueDescription: WatchDirectoryKind.UseFsEvents,
|
||||
},
|
||||
{
|
||||
name: "fallbackPolling",
|
||||
@@ -139,13 +145,14 @@ namespace ts {
|
||||
})),
|
||||
category: Diagnostics.Watch_and_Build_Modes,
|
||||
description: Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
|
||||
defaultValueDescription: PollingWatchKind.PriorityInterval,
|
||||
},
|
||||
{
|
||||
name: "synchronousWatchDirectory",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Watch_and_Build_Modes,
|
||||
description: Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "excludeDirectories",
|
||||
@@ -182,13 +189,13 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Print_this_message,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
shortName: "?",
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "watch",
|
||||
@@ -198,7 +205,7 @@ namespace ts {
|
||||
isCommandLineOnly: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Watch_input_files,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "preserveWatchOutput",
|
||||
@@ -206,28 +213,28 @@ namespace ts {
|
||||
showInSimplifiedHelpView: false,
|
||||
category: Diagnostics.Output_Formatting,
|
||||
description: Diagnostics.Disable_wiping_the_console_in_watch_mode,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "listFiles",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Print_all_of_the_files_read_during_the_compilation,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "explainFiles",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "listEmittedFiles",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "pretty",
|
||||
@@ -235,28 +242,28 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Output_Formatting,
|
||||
description: Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
|
||||
defaultValueDescription: "true"
|
||||
defaultValueDescription: true,
|
||||
},
|
||||
{
|
||||
name: "traceResolution",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Log_paths_used_during_the_moduleResolution_process,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "diagnostics",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Output_compiler_performance_information_after_building,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "extendedDiagnostics",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Compiler_Diagnostics,
|
||||
description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "generateCpuProfile",
|
||||
@@ -292,7 +299,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Watch_and_Build_Modes,
|
||||
description: Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "locale",
|
||||
@@ -329,7 +336,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
|
||||
defaultValueDescription: "ES3"
|
||||
defaultValueDescription: ScriptTarget.ES3,
|
||||
};
|
||||
|
||||
const commandOptionsWithoutBuild: CommandLineOption[] = [
|
||||
@@ -340,7 +347,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Show_all_compiler_options,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
@@ -349,7 +356,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Print_the_compiler_s_version,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
@@ -357,7 +364,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "project",
|
||||
@@ -376,7 +383,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "showConfig",
|
||||
@@ -385,7 +392,7 @@ namespace ts {
|
||||
category: Diagnostics.Command_line_Options,
|
||||
isCommandLineOnly: true,
|
||||
description: Diagnostics.Print_the_final_configuration_instead_of_building,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "listFilesOnly",
|
||||
@@ -395,7 +402,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
isCommandLineOnly: true,
|
||||
description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Basic
|
||||
@@ -423,13 +430,15 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Specify_what_module_code_is_generated,
|
||||
defaultValueDescription: undefined,
|
||||
},
|
||||
{
|
||||
name: "lib",
|
||||
type: "list",
|
||||
element: {
|
||||
name: "lib",
|
||||
type: libMap
|
||||
type: libMap,
|
||||
defaultValueDescription: undefined,
|
||||
},
|
||||
affectsProgramStructure: true,
|
||||
showInSimplifiedHelpView: true,
|
||||
@@ -444,7 +453,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.JavaScript_Support,
|
||||
description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "checkJs",
|
||||
@@ -452,7 +461,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.JavaScript_Support,
|
||||
description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "jsx",
|
||||
@@ -464,7 +473,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Specify_what_JSX_code_is_generated,
|
||||
defaultValueDescription: "undefined"
|
||||
defaultValueDescription: undefined,
|
||||
},
|
||||
{
|
||||
name: "declaration",
|
||||
@@ -484,7 +493,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Emit,
|
||||
transpileOptionValue: undefined,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
description: Diagnostics.Create_sourcemaps_for_d_ts_files
|
||||
},
|
||||
{
|
||||
@@ -496,7 +505,7 @@ namespace ts {
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
|
||||
transpileOptionValue: undefined,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "sourceMap",
|
||||
@@ -504,7 +513,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Emit,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
|
||||
},
|
||||
{
|
||||
@@ -545,7 +554,7 @@ namespace ts {
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Projects,
|
||||
transpileOptionValue: undefined,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
description: Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references,
|
||||
},
|
||||
{
|
||||
@@ -565,7 +574,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Emit,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
description: Diagnostics.Disable_emitting_comments,
|
||||
},
|
||||
{
|
||||
@@ -575,7 +584,7 @@ namespace ts {
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Disable_emitting_files_from_a_compilation,
|
||||
transpileOptionValue: undefined,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "importHelpers",
|
||||
@@ -583,7 +592,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "importsNotUsedAsValues",
|
||||
@@ -595,7 +604,8 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types
|
||||
description: Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
|
||||
defaultValueDescription: ImportsNotUsedAsValues.Remove,
|
||||
},
|
||||
{
|
||||
name: "downlevelIteration",
|
||||
@@ -603,7 +613,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "isolatedModules",
|
||||
@@ -611,7 +621,7 @@ namespace ts {
|
||||
category: Diagnostics.Interop_Constraints,
|
||||
description: Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,
|
||||
transpileOptionValue: true,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Strict Type Checks
|
||||
@@ -623,7 +633,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Enable_all_strict_type_checking_options,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noImplicitAny",
|
||||
@@ -684,7 +694,7 @@ namespace ts {
|
||||
strictFlag: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "alwaysStrict",
|
||||
@@ -703,7 +713,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noUnusedParameters",
|
||||
@@ -711,7 +721,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "exactOptionalPropertyTypes",
|
||||
@@ -719,7 +729,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noImplicitReturns",
|
||||
@@ -727,7 +737,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noFallthroughCasesInSwitch",
|
||||
@@ -736,7 +746,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noUncheckedIndexedAccess",
|
||||
@@ -744,7 +754,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Include_undefined_in_index_signature_results,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noImplicitOverride",
|
||||
@@ -752,7 +762,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noPropertyAccessFromIndexSignature",
|
||||
@@ -760,7 +770,7 @@ namespace ts {
|
||||
showInSimplifiedHelpView: false,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Module Resolution
|
||||
@@ -855,14 +865,14 @@ namespace ts {
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Interop_Constraints,
|
||||
description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "preserveSymlinks",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Interop_Constraints,
|
||||
description: Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "allowUmdGlobalAccess",
|
||||
@@ -870,7 +880,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Allow_accessing_UMD_globals_from_modules,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Source Maps
|
||||
@@ -896,7 +906,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "inlineSources",
|
||||
@@ -904,7 +914,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Experimental
|
||||
@@ -914,7 +924,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
@@ -923,7 +933,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Language_and_Environment,
|
||||
description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
// Advanced
|
||||
@@ -956,7 +966,7 @@ namespace ts {
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Modules,
|
||||
description: Diagnostics.Enable_importing_json_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
{
|
||||
@@ -983,7 +993,7 @@ namespace ts {
|
||||
type: "boolean",
|
||||
category: Diagnostics.Completeness,
|
||||
description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "charset",
|
||||
@@ -998,7 +1008,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "newLine",
|
||||
@@ -1018,7 +1028,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Output_Formatting,
|
||||
description: Diagnostics.Disable_truncating_types_in_error_messages,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noLib",
|
||||
@@ -1029,7 +1039,7 @@ namespace ts {
|
||||
// We are not returning a sourceFile for lib file when asked by the program,
|
||||
// so pass --noLib to avoid reporting a file not found error.
|
||||
transpileOptionValue: true,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noResolve",
|
||||
@@ -1040,7 +1050,7 @@ namespace ts {
|
||||
// We are not doing a full typecheck, we are not resolving the whole context,
|
||||
// so pass --noResolve to avoid reporting missing file errors.
|
||||
transpileOptionValue: true,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "stripInternal",
|
||||
@@ -1048,7 +1058,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "disableSizeLimit",
|
||||
@@ -1056,7 +1066,7 @@ namespace ts {
|
||||
affectsProgramStructure: true,
|
||||
category: Diagnostics.Editor_Support,
|
||||
description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "disableSourceOfProjectReferenceRedirect",
|
||||
@@ -1064,7 +1074,7 @@ namespace ts {
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Projects,
|
||||
description: Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "disableSolutionSearching",
|
||||
@@ -1072,7 +1082,7 @@ namespace ts {
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Projects,
|
||||
description: Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "disableReferencedProjectLoad",
|
||||
@@ -1080,7 +1090,7 @@ namespace ts {
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Projects,
|
||||
description: Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noImplicitUseStrict",
|
||||
@@ -1088,7 +1098,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noEmitHelpers",
|
||||
@@ -1096,7 +1106,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "noEmitOnError",
|
||||
@@ -1105,7 +1115,7 @@ namespace ts {
|
||||
category: Diagnostics.Emit,
|
||||
transpileOptionValue: undefined,
|
||||
description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "preserveConstEnums",
|
||||
@@ -1113,7 +1123,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "declarationDir",
|
||||
@@ -1130,7 +1140,7 @@ namespace ts {
|
||||
type: "boolean",
|
||||
category: Diagnostics.Completeness,
|
||||
description: Diagnostics.Skip_type_checking_all_d_ts_files,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "allowUnusedLabels",
|
||||
@@ -1139,7 +1149,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Disable_error_reporting_for_unused_labels,
|
||||
defaultValueDescription: "undefined"
|
||||
defaultValueDescription: undefined,
|
||||
},
|
||||
{
|
||||
name: "allowUnreachableCode",
|
||||
@@ -1148,7 +1158,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Disable_error_reporting_for_unreachable_code,
|
||||
defaultValueDescription: "undefined"
|
||||
defaultValueDescription: undefined,
|
||||
},
|
||||
{
|
||||
name: "suppressExcessPropertyErrors",
|
||||
@@ -1156,7 +1166,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "suppressImplicitAnyIndexErrors",
|
||||
@@ -1164,7 +1174,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "forceConsistentCasingInFileNames",
|
||||
@@ -1172,7 +1182,7 @@ namespace ts {
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Interop_Constraints,
|
||||
description: Diagnostics.Ensure_that_casing_is_correct_in_imports,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "maxNodeModuleJsDepth",
|
||||
@@ -1180,7 +1190,7 @@ namespace ts {
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.JavaScript_Support,
|
||||
description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,
|
||||
defaultValueDescription: "0"
|
||||
defaultValueDescription: 0,
|
||||
},
|
||||
{
|
||||
name: "noStrictGenericChecks",
|
||||
@@ -1188,7 +1198,7 @@ namespace ts {
|
||||
affectsSemanticDiagnostics: true,
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "useDefineForClassFields",
|
||||
@@ -1205,7 +1215,7 @@ namespace ts {
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Emit,
|
||||
description: Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
|
||||
{
|
||||
@@ -1213,7 +1223,7 @@ namespace ts {
|
||||
type: "boolean",
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,
|
||||
defaultValueDescription: "false"
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
// A list of plugins to load in the language service
|
||||
@@ -1269,7 +1279,7 @@ namespace ts {
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Enable_verbose_logging,
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "dry",
|
||||
@@ -1277,7 +1287,7 @@ namespace ts {
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "force",
|
||||
@@ -1285,14 +1295,14 @@ namespace ts {
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "clean",
|
||||
category: Diagnostics.Command_line_Options,
|
||||
description: Diagnostics.Delete_the_outputs_of_all_projects,
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1310,12 +1320,12 @@ namespace ts {
|
||||
*/
|
||||
name: "enableAutoDiscovery",
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "enable",
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
{
|
||||
name: "include",
|
||||
@@ -1336,7 +1346,7 @@ namespace ts {
|
||||
{
|
||||
name: "disableFilenameBasedTypeAcquisition",
|
||||
type: "boolean",
|
||||
defaultValueDescription: "false",
|
||||
defaultValueDescription: false,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -4539,9 +4539,10 @@ namespace ts {
|
||||
// - "(x,y)" is a comma expression parsed as a signature with two parameters.
|
||||
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
|
||||
// - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
|
||||
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
|
||||
//
|
||||
// So we need just a bit of lookahead to ensure that it can only be a signature.
|
||||
const hasJSDocFunctionType = type && isJSDocFunctionType(type);
|
||||
const hasJSDocFunctionType = type && (isJSDocFunctionType(type) || isParenthesizedTypeNode(type) && isJSDocFunctionType(type.type));
|
||||
if (!allowAmbiguity && token() !== SyntaxKind.EqualsGreaterThanToken && (hasJSDocFunctionType || token() !== SyntaxKind.OpenBraceToken)) {
|
||||
// Returning undefined here will cause our caller to rewind to where we started from.
|
||||
return undefined;
|
||||
|
||||
@@ -6335,7 +6335,7 @@ namespace ts {
|
||||
isFilePath?: boolean; // True if option value is a path or fileName
|
||||
shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'
|
||||
description?: DiagnosticMessage; // The message describing what the command line switch does.
|
||||
defaultValueDescription?: string | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
|
||||
defaultValueDescription?: string | number | boolean | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
|
||||
paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter
|
||||
isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file
|
||||
isCommandLineOnly?: boolean;
|
||||
@@ -6355,23 +6355,25 @@ namespace ts {
|
||||
/* @internal */
|
||||
export interface CommandLineOptionOfStringType extends CommandLineOptionBase {
|
||||
type: "string";
|
||||
defaultValueDescription?: string | undefined | DiagnosticMessage;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface CommandLineOptionOfNumberType extends CommandLineOptionBase {
|
||||
type: "number";
|
||||
defaultValueDescription: `${number | undefined}` | DiagnosticMessage;
|
||||
defaultValueDescription: number | undefined | DiagnosticMessage;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface CommandLineOptionOfBooleanType extends CommandLineOptionBase {
|
||||
type: "boolean";
|
||||
defaultValueDescription: `${boolean | undefined}` | DiagnosticMessage;
|
||||
defaultValueDescription: boolean | undefined | DiagnosticMessage;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface CommandLineOptionOfCustomType extends CommandLineOptionBase {
|
||||
type: ESMap<string, number | string>; // an object literal mapping named values to actual values
|
||||
defaultValueDescription: number | string | undefined | DiagnosticMessage;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -160,7 +160,13 @@ namespace ts {
|
||||
|
||||
// value type and possible value
|
||||
const valueCandidates = getValueCandidate(option);
|
||||
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : option.defaultValueDescription;
|
||||
const defaultValueDescription =
|
||||
typeof option.defaultValueDescription === "object"
|
||||
? getDiagnosticText(option.defaultValueDescription)
|
||||
: formatDefaultValue(
|
||||
option.defaultValueDescription,
|
||||
option.type === "list" ? option.element.type : option.type
|
||||
);
|
||||
const terminalWidth = sys.getWidthOfTerminal?.() ?? 0;
|
||||
|
||||
// Note: child_process might return `terminalWidth` as undefined.
|
||||
@@ -203,6 +209,19 @@ namespace ts {
|
||||
}
|
||||
return text;
|
||||
|
||||
function formatDefaultValue(
|
||||
defaultValue: CommandLineOption["defaultValueDescription"],
|
||||
type: CommandLineOption["type"]
|
||||
) {
|
||||
return defaultValue !== undefined && typeof type === "object"
|
||||
// e.g. ScriptTarget.ES2015 -> "es6/es2015"
|
||||
? arrayFrom(type.entries())
|
||||
.filter(([, value]) => value === defaultValue)
|
||||
.map(([name]) => name)
|
||||
.join("/")
|
||||
: String(defaultValue);
|
||||
}
|
||||
|
||||
function showAdditionalInfoOutput(valueCandidates: ValueCandidate | undefined, option: CommandLineOption): boolean {
|
||||
const ignoreValues = ["string"];
|
||||
const ignoredDescriptions = [undefined, "false", "n/a"];
|
||||
@@ -286,8 +305,14 @@ namespace ts {
|
||||
break;
|
||||
default:
|
||||
// ESMap<string, number | string>
|
||||
const keys = arrayFrom(option.type.keys());
|
||||
possibleValues = keys.join(", ");
|
||||
// Group synonyms: es6/es2015
|
||||
const inverted: { [value: string]: string[] } = {};
|
||||
option.type.forEach((value, name) => {
|
||||
(inverted[value] ||= []).push(name);
|
||||
});
|
||||
return getEntries(inverted)
|
||||
.map(([, synonyms]) => synonyms.join("/"))
|
||||
.join(", ");
|
||||
}
|
||||
return possibleValues;
|
||||
}
|
||||
|
||||
@@ -304,21 +304,21 @@ namespace Harness {
|
||||
|
||||
// Additional options not already in ts.optionDeclarations
|
||||
const harnessOptionDeclarations: ts.CommandLineOption[] = [
|
||||
{ name: "allowNonTsExtensions", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "useCaseSensitiveFileNames", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "allowNonTsExtensions", type: "boolean", defaultValueDescription: false },
|
||||
{ name: "useCaseSensitiveFileNames", type: "boolean", defaultValueDescription: false },
|
||||
{ name: "baselineFile", type: "string" },
|
||||
{ name: "includeBuiltFile", type: "string" },
|
||||
{ name: "fileName", type: "string" },
|
||||
{ name: "libFiles", type: "string" },
|
||||
{ name: "noErrorTruncation", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "suppressOutputPathCheck", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "noImplicitReferences", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "noErrorTruncation", type: "boolean", defaultValueDescription: false },
|
||||
{ name: "suppressOutputPathCheck", type: "boolean", defaultValueDescription: false },
|
||||
{ name: "noImplicitReferences", type: "boolean", defaultValueDescription: false },
|
||||
{ name: "currentDirectory", type: "string" },
|
||||
{ name: "symlink", type: "string" },
|
||||
{ name: "link", type: "string" },
|
||||
{ name: "noTypesAndSymbols", type: "boolean", defaultValueDescription: "false" },
|
||||
{ name: "noTypesAndSymbols", type: "boolean", defaultValueDescription: false },
|
||||
// Emitted js baseline will print full paths for every output file
|
||||
{ name: "fullEmitPaths", type: "boolean", defaultValueDescription: "false" }
|
||||
{ name: "fullEmitPaths", type: "boolean", defaultValueDescription: false },
|
||||
];
|
||||
|
||||
let optionsIndex: ts.ESMap<string, ts.CommandLineOption>;
|
||||
|
||||
@@ -534,7 +534,7 @@ namespace ts {
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Backwards_Compatibility,
|
||||
description: Diagnostics.Enable_project_compilation,
|
||||
defaultValueDescription: "undefined",
|
||||
defaultValueDescription: undefined,
|
||||
}
|
||||
];
|
||||
return {
|
||||
|
||||
@@ -130,9 +130,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
MapShim = ShimCollections.createMapShim(getIterator);
|
||||
afterEach(() => {
|
||||
MapShim = undefined!;
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
MapShim = undefined!;
|
||||
});
|
||||
|
||||
it("iterates values in insertion order and handles changes with string keys", () => {
|
||||
|
||||
@@ -128,9 +128,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
SetShim = ShimCollections.createSetShim(getIterator);
|
||||
afterEach(() => {
|
||||
SetShim = undefined!;
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
SetShim = undefined!;
|
||||
});
|
||||
|
||||
it("iterates values in insertion order and handles changes with string keys", () => {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
namespace ts {
|
||||
describe("unittests:: debugDeprecation", () => {
|
||||
let loggingHost: LoggingHost | undefined;
|
||||
beforeEach(() => {
|
||||
const loggingHost = Debug.loggingHost;
|
||||
afterEach(() => {
|
||||
Debug.loggingHost = loggingHost;
|
||||
});
|
||||
loggingHost = Debug.loggingHost;
|
||||
});
|
||||
afterEach(() => {
|
||||
Debug.loggingHost = loggingHost;
|
||||
loggingHost = undefined;
|
||||
});
|
||||
describe("deprecateFunction", () => {
|
||||
it("silent deprecation", () => {
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
//// [parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts]
|
||||
let a: any;
|
||||
const c = true ? (a) : (function() {});
|
||||
|
||||
|
||||
//// [parserParenthesizedVariableAndParenthesizedFunctionInTernary.js]
|
||||
var a;
|
||||
var c = true ? (a) : (function () { });
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts ===
|
||||
let a: any;
|
||||
>a : Symbol(a, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 0, 3))
|
||||
|
||||
const c = true ? (a) : (function() {});
|
||||
>c : Symbol(c, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 1, 5))
|
||||
>a : Symbol(a, Decl(parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts, 0, 3))
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts ===
|
||||
let a: any;
|
||||
>a : any
|
||||
|
||||
const c = true ? (a) : (function() {});
|
||||
>c : any
|
||||
>true ? (a) : (function() {}) : any
|
||||
>true : true
|
||||
>(a) : any
|
||||
>a : any
|
||||
>(function() {}) : () => void
|
||||
>function() {} : () => void
|
||||
|
||||
+7
-5
@@ -68,16 +68,18 @@ default: true
|
||||
|
||||
--target, -t
|
||||
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
|
||||
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: ES3
|
||||
one of: es3, es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: es3
|
||||
|
||||
--module, -m
|
||||
Specify what module code is generated.
|
||||
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, node12, nodenext
|
||||
one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext
|
||||
default: undefined
|
||||
|
||||
--lib
|
||||
Specify a set of bundled library declaration files that describe the target runtime environment.
|
||||
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
|
||||
one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl
|
||||
default: undefined
|
||||
|
||||
--allowJs
|
||||
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
|
||||
@@ -91,7 +93,7 @@ default: false
|
||||
|
||||
--jsx
|
||||
Specify what JSX code is generated.
|
||||
one of: preserve, react-native, react, react-jsx, react-jsxdev
|
||||
one of: preserve, react, react-native, react-jsx, react-jsxdev
|
||||
default: undefined
|
||||
|
||||
--declaration, -d
|
||||
|
||||
+7
-5
@@ -68,16 +68,18 @@ default: true
|
||||
|
||||
[94m--target, -t[39m
|
||||
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
|
||||
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: ES3
|
||||
one of: es3, es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: es3
|
||||
|
||||
[94m--module, -m[39m
|
||||
Specify what module code is generated.
|
||||
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, node12, nodenext
|
||||
one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext
|
||||
default: undefined
|
||||
|
||||
[94m--lib[39m
|
||||
Specify a set of bundled library declaration files that describe the target runtime environment.
|
||||
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
|
||||
one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl
|
||||
default: undefined
|
||||
|
||||
[94m--allowJs[39m
|
||||
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
|
||||
@@ -91,7 +93,7 @@ default: false
|
||||
|
||||
[94m--jsx[39m
|
||||
Specify what JSX code is generated.
|
||||
one of: preserve, react-native, react, react-jsx, react-jsxdev
|
||||
one of: preserve, react, react-native, react-jsx, react-jsxdev
|
||||
default: undefined
|
||||
|
||||
[94m--declaration, -d[39m
|
||||
|
||||
+7
-5
@@ -68,16 +68,18 @@ default: true
|
||||
|
||||
[94m--target, -t[39m
|
||||
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
|
||||
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: ES3
|
||||
one of: es3, es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
|
||||
default: es3
|
||||
|
||||
[94m--module, -m[39m
|
||||
Specify what module code is generated.
|
||||
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, es2022, esnext, node12, nodenext
|
||||
one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext
|
||||
default: undefined
|
||||
|
||||
[94m--lib[39m
|
||||
Specify a set of bundled library declaration files that describe the target runtime environment.
|
||||
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, es2021.intl, es2022.array, es2022.error, es2022.object, es2022.string, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
|
||||
one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl
|
||||
default: undefined
|
||||
|
||||
[94m--allowJs[39m
|
||||
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
|
||||
@@ -91,7 +93,7 @@ default: false
|
||||
|
||||
[94m--jsx[39m
|
||||
Specify what JSX code is generated.
|
||||
one of: preserve, react-native, react, react-jsx, react-jsxdev
|
||||
one of: preserve, react, react-native, react-jsx, react-jsxdev
|
||||
default: undefined
|
||||
|
||||
[94m--declaration, -d[39m
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
let a: any;
|
||||
const c = true ? (a) : (function() {});
|
||||
Reference in New Issue
Block a user