mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
NoEmit and incremental are allowed with listFilesOnly (#36488)
Fixes #32882
This commit is contained in:
parent
e87b2e3506
commit
8eee8db192
@ -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");
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : 10
|
||||
>10 : 10
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : 10
|
||||
>10 : 10
|
||||
|
||||
12
tests/cases/compiler/noEmitAndCompositeListFilesOnly.ts
Normal file
12
tests/cases/compiler/noEmitAndCompositeListFilesOnly.ts
Normal file
@ -0,0 +1,12 @@
|
||||
// @listFilesOnly: true
|
||||
|
||||
// @Filename: /a.ts
|
||||
const x = 10;
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"composite": true
|
||||
}
|
||||
}
|
||||
13
tests/cases/compiler/noEmitAndIncrementalListFilesOnly.ts
Normal file
13
tests/cases/compiler/noEmitAndIncrementalListFilesOnly.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// @listFilesOnly: true
|
||||
|
||||
// @Filename: /a.ts
|
||||
const x = 10;
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"incremental": true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user