Skip to content

Commit 8eee8db

Browse files
authored
NoEmit and incremental are allowed with listFilesOnly (#36488)
Fixes #32882
1 parent e87b2e3 commit 8eee8db

7 files changed

+44
-1
lines changed

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ namespace ts {
29872987
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
29882988
}
29892989

2990-
if (options.noEmit && isIncrementalCompilation(options)) {
2990+
if (!options.listFilesOnly && options.noEmit && isIncrementalCompilation(options)) {
29912991
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", options.incremental ? "incremental" : "composite");
29922992
}
29932993

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== /a.ts ===
2+
const x = 10;
3+
>x : Symbol(x, Decl(a.ts, 0, 5))
4+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=== /a.ts ===
2+
const x = 10;
3+
>x : 10
4+
>10 : 10
5+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== /a.ts ===
2+
const x = 10;
3+
>x : Symbol(x, Decl(a.ts, 0, 5))
4+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=== /a.ts ===
2+
const x = 10;
3+
>x : 10
4+
>10 : 10
5+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @listFilesOnly: true
2+
3+
// @Filename: /a.ts
4+
const x = 10;
5+
6+
// @Filename: /tsconfig.json
7+
{
8+
"compilerOptions": {
9+
"noEmit": true,
10+
"composite": true
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @listFilesOnly: true
2+
3+
// @Filename: /a.ts
4+
const x = 10;
5+
6+
// @Filename: /tsconfig.json
7+
{
8+
"compilerOptions": {
9+
"noEmit": true,
10+
"incremental": true
11+
}
12+
}
13+

0 commit comments

Comments
 (0)