From efe57733cac305533c61c7bea3d51b302bbb4d19 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 13 Jan 2018 16:52:21 +0700 Subject: [PATCH] Add a way to override description for tsconfig.json --- src/compiler/commandLineParser.ts | 6 ++++-- src/compiler/types.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4813d4b4300..877928ba1a1 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -151,7 +151,8 @@ namespace ts { }, showInSimplifiedHelpView: true, category: Diagnostics.Basic_Options, - description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon, + descriptionOnTSConfig: Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -1351,7 +1352,8 @@ namespace ts { optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; } nameColumn.push(optionName); - descriptionColumn.push(`/* ${option.description && getLocaleSpecificMessage(option.description) || option.name} */`); + const optionDescription = option.descriptionOnTSConfig || option.description; + descriptionColumn.push(`/* ${optionDescription && getLocaleSpecificMessage(optionDescription) || option.name} */`); marginLength = Math.max(optionName.length, marginLength); } }); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e4ada136730..2265339d64b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4120,6 +4120,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 + descriptionOnTSConfig?: DiagnosticMessage; // The message describing what the option does in tsconfig.json file 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;