mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Allow --incremental to be command line option
This commit is contained in:
@@ -136,6 +136,13 @@ namespace ts {
|
||||
category: Diagnostics.Advanced_Options,
|
||||
description: Diagnostics.Show_verbose_diagnostic_information
|
||||
},
|
||||
{
|
||||
name: "incremental",
|
||||
shortName: "i",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Enable_incremental_compilation,
|
||||
},
|
||||
];
|
||||
|
||||
/* @internal */
|
||||
@@ -331,13 +338,6 @@ namespace ts {
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Enable_project_compilation,
|
||||
},
|
||||
{
|
||||
name: "incremental",
|
||||
type: "boolean",
|
||||
isTSConfigOnly: true,
|
||||
category: Diagnostics.Basic_Options,
|
||||
description: Diagnostics.Enable_incremental_compilation,
|
||||
},
|
||||
{
|
||||
name: "tsBuildInfoFile",
|
||||
type: "string",
|
||||
|
||||
@@ -3072,6 +3072,10 @@
|
||||
"category": "Error",
|
||||
"code": 5073
|
||||
},
|
||||
"Option '--incremental' can only be speicified when using tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 5074
|
||||
},
|
||||
|
||||
"Generates a sourcemap for each corresponding '.d.ts' file.": {
|
||||
"category": "Message",
|
||||
|
||||
@@ -2722,6 +2722,10 @@ namespace ts {
|
||||
createDiagnosticForOptionName(Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths");
|
||||
}
|
||||
|
||||
if (options.incremental && !options.configFilePath) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_speicified_when_using_tsconfig));
|
||||
}
|
||||
|
||||
if (options.composite) {
|
||||
if (options.declaration === false) {
|
||||
createDiagnosticForOptionName(Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration");
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace ts {
|
||||
listEmittedFiles?: boolean;
|
||||
listFiles?: boolean;
|
||||
pretty?: boolean;
|
||||
incremental?: boolean;
|
||||
|
||||
traceResolution?: boolean;
|
||||
/* @internal */ diagnostics?: boolean;
|
||||
@@ -363,7 +364,7 @@ namespace ts {
|
||||
function getCompilerOptionsOfBuildOptions(buildOptions: BuildOptions): CompilerOptions {
|
||||
const result = {} as CompilerOptions;
|
||||
commonOptionsWithBuild.forEach(option => {
|
||||
result[option.name] = buildOptions[option.name];
|
||||
if (hasProperty(buildOptions, option.name)) result[option.name] = buildOptions[option.name];
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -370,16 +370,9 @@ namespace ts {
|
||||
// --lib es6 0.ts
|
||||
assertParseResult(["--incremental", "0.ts"],
|
||||
{
|
||||
errors: [{
|
||||
messageText: "Option 'incremental' can only be specified in 'tsconfig.json' file.",
|
||||
category: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file.category,
|
||||
code: Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file.code,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
}],
|
||||
errors: [],
|
||||
fileNames: ["0.ts"],
|
||||
options: {}
|
||||
options: { incremental: true }
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -477,16 +470,9 @@ namespace ts {
|
||||
// --lib es6 0.ts
|
||||
assertParseResult(["--incremental", "tests"],
|
||||
{
|
||||
errors: [{
|
||||
messageText: "Unknown build option '--incremental'.",
|
||||
category: Diagnostics.Unknown_build_option_0.category,
|
||||
code: Diagnostics.Unknown_build_option_0.code,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
}],
|
||||
errors: [],
|
||||
projects: ["tests"],
|
||||
buildOptions: { }
|
||||
buildOptions: { incremental: true }
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user