NoEmit and incremental are allowed with listFilesOnly (#36488)

Fixes #32882
This commit is contained in:
Sheetal Nandi 2020-01-28 15:59:09 -08:00 committed by GitHub
parent e87b2e3506
commit 8eee8db192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 44 additions and 1 deletions

View File

@ -2987,7 +2987,7 @@ namespace ts {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
}
if (options.noEmit && isIncrementalCompilation(options)) {
if (!options.listFilesOnly && options.noEmit && isIncrementalCompilation(options)) {
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", options.incremental ? "incremental" : "composite");
}

View File

@ -0,0 +1,4 @@
=== /a.ts ===
const x = 10;
>x : Symbol(x, Decl(a.ts, 0, 5))

View File

@ -0,0 +1,5 @@
=== /a.ts ===
const x = 10;
>x : 10
>10 : 10

View File

@ -0,0 +1,4 @@
=== /a.ts ===
const x = 10;
>x : Symbol(x, Decl(a.ts, 0, 5))

View File

@ -0,0 +1,5 @@
=== /a.ts ===
const x = 10;
>x : 10
>10 : 10

View File

@ -0,0 +1,12 @@
// @listFilesOnly: true
// @Filename: /a.ts
const x = 10;
// @Filename: /tsconfig.json
{
"compilerOptions": {
"noEmit": true,
"composite": true
}
}

View File

@ -0,0 +1,13 @@
// @listFilesOnly: true
// @Filename: /a.ts
const x = 10;
// @Filename: /tsconfig.json
{
"compilerOptions": {
"noEmit": true,
"incremental": true
}
}