mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into requireJson
This commit is contained in:
@@ -194,6 +194,13 @@ namespace ts {
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Generates_corresponding_d_ts_file,
|
||||
},
|
||||
{
|
||||
name: "declarationMap",
|
||||
type: "boolean",
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Generates_a_sourcemap_for_each_corresponding_d_ts_file,
|
||||
},
|
||||
{
|
||||
name: "emitDeclarationOnly",
|
||||
type: "boolean",
|
||||
@@ -1345,12 +1352,21 @@ namespace ts {
|
||||
return Array(paddingLength + 1).join(" ");
|
||||
}
|
||||
|
||||
function isAllowedOption({ category, name }: CommandLineOption): boolean {
|
||||
// Skip options which do not have a category or have category `Command_line_Options`
|
||||
// Exclude all possible `Advanced_Options` in tsconfig.json which were NOT defined in command line
|
||||
return category !== undefined
|
||||
&& category !== Diagnostics.Command_line_Options
|
||||
&& (category !== Diagnostics.Advanced_Options || compilerOptionsMap.has(name));
|
||||
}
|
||||
|
||||
function writeConfigurations() {
|
||||
// Filter applicable options to place in the file
|
||||
const categorizedOptions = createMultiMap<CommandLineOption>();
|
||||
for (const option of optionDeclarations) {
|
||||
const { category } = option;
|
||||
if (category !== undefined && category !== Diagnostics.Command_line_Options && category !== Diagnostics.Advanced_Options) {
|
||||
|
||||
if (isAllowedOption(option)) {
|
||||
categorizedOptions.add(getLocaleSpecificMessage(category), option);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user