Skip to content

Commit 87dd3ee

Browse files
committed
Remove from help
1 parent 75c8a27 commit 87dd3ee

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
966966
type: "boolean",
967967
affectsSemanticDiagnostics: true,
968968
affectsBuildInfo: true,
969+
showInHelp: false,
969970
category: Diagnostics.Type_Checking,
970971
description: Diagnostics.Ensure_types_are_ordered_stably_and_deterministically_across_compilations,
971972
defaultValueDescription: false,

src/compiler/executeCommandLine.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,11 @@ function shouldBePretty(sys: System, options: CompilerOptions | BuildOptions) {
174174
}
175175

176176
function getOptionsForHelp(commandLine: ParsedCommandLine) {
177+
const helpOptions = filter(optionDeclarations.concat(tscBuildOption), option => option.showInHelp !== false);
177178
// Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
178179
return !!commandLine.options.all ?
179-
toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) :
180-
filter(optionDeclarations.concat(tscBuildOption), v => !!v.showInSimplifiedHelpView);
180+
toSorted(helpOptions, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) :
181+
filter(helpOptions, v => !!v.showInSimplifiedHelpView);
181182
}
182183

183184
function printVersion(sys: System) {
@@ -512,16 +513,16 @@ function printEasyHelp(sys: System, simpleOptions: readonly CommandLineOption[])
512513
function printAllHelp(sys: System, compilerOptions: readonly CommandLineOption[], buildOptions: readonly CommandLineOption[], watchOptions: readonly CommandLineOption[]) {
513514
let output: string[] = [...getHeader(sys, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
514515
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /*beforeOptionsDescription*/ undefined, formatMessage(Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc"))];
515-
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.WATCH_OPTIONS), watchOptions, /*subCategory*/ false, getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))];
516-
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), filter(buildOptions, option => option !== tscBuildOption), /*subCategory*/ false, formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))];
516+
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.WATCH_OPTIONS), filter(watchOptions, option => option.showInHelp !== false), /*subCategory*/ false, getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))];
517+
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), filter(buildOptions, option => option !== tscBuildOption && option.showInHelp !== false), /*subCategory*/ false, formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))];
517518
for (const line of output) {
518519
sys.write(line);
519520
}
520521
}
521522

522523
function printBuildHelp(sys: System, buildOptions: readonly CommandLineOption[]) {
523524
let output: string[] = [...getHeader(sys, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
524-
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), filter(buildOptions, option => option !== tscBuildOption), /*subCategory*/ false, formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))];
525+
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), filter(buildOptions, option => option !== tscBuildOption && option.showInHelp !== false), /*subCategory*/ false, formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))];
525526
for (const line of output) {
526527
sys.write(line);
527528
}

src/compiler/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7759,6 +7759,7 @@ export interface CommandLineOptionBase {
77597759
isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file
77607760
isCommandLineOnly?: boolean;
77617761
showInSimplifiedHelpView?: boolean;
7762+
showInHelp?: boolean;
77627763
category?: DiagnosticMessage;
77637764
strictFlag?: true; // true if the option is one of the flag under strict
77647765
allowJsFlag?: true;

tests/baselines/reference/tsc/commandLine/help-all.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,6 @@ Raise an error when a function parameter isn't read.
271271
type: boolean
272272
default: false
273273

274-
--stableTypeOrdering
275-
Ensure types are ordered stably and deterministically across compilations.
276-
type: boolean
277-
default: false
278-
279274
--strict
280275
Enable all strict type-checking options.
281276
type: boolean

0 commit comments

Comments
 (0)