mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 17:41:26 -06:00
Merge pull request #32887 from microsoft/incrementalNoEmit
Disallow incremental with noEmit
This commit is contained in:
commit
2483803398
@ -2850,6 +2850,10 @@ 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)) {
|
||||
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", options.incremental ? "incremental" : "composite");
|
||||
}
|
||||
|
||||
verifyProjectReferences();
|
||||
|
||||
// List of collected files is complete; validate exhautiveness if this is a project with a file list
|
||||
|
||||
19
tests/baselines/reference/noEmitAndComposite.errors.txt
Normal file
19
tests/baselines/reference/noEmitAndComposite.errors.txt
Normal file
@ -0,0 +1,19 @@
|
||||
/tsconfig.json(3,9): error TS5053: Option 'noEmit' cannot be specified with option 'composite'.
|
||||
/tsconfig.json(4,9): error TS5053: Option 'noEmit' cannot be specified with option 'composite'.
|
||||
|
||||
|
||||
==== /tsconfig.json (2 errors) ====
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
~~~~~~~~
|
||||
!!! error TS5053: Option 'noEmit' cannot be specified with option 'composite'.
|
||||
"composite": true
|
||||
~~~~~~~~~~~
|
||||
!!! error TS5053: Option 'noEmit' cannot be specified with option 'composite'.
|
||||
}
|
||||
}
|
||||
|
||||
==== /a.ts (0 errors) ====
|
||||
const x = 10;
|
||||
|
||||
4
tests/baselines/reference/noEmitAndComposite.symbols
Normal file
4
tests/baselines/reference/noEmitAndComposite.symbols
Normal file
@ -0,0 +1,4 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
5
tests/baselines/reference/noEmitAndComposite.types
Normal file
5
tests/baselines/reference/noEmitAndComposite.types
Normal file
@ -0,0 +1,5 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : 10
|
||||
>10 : 10
|
||||
|
||||
20
tests/baselines/reference/noEmitAndIncremental.errors.txt
Normal file
20
tests/baselines/reference/noEmitAndIncremental.errors.txt
Normal file
@ -0,0 +1,20 @@
|
||||
/tsconfig.json(3,9): error TS5053: Option 'noEmit' cannot be specified with option 'incremental'.
|
||||
/tsconfig.json(4,9): error TS5053: Option 'noEmit' cannot be specified with option 'incremental'.
|
||||
|
||||
|
||||
==== /tsconfig.json (2 errors) ====
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
~~~~~~~~
|
||||
!!! error TS5053: Option 'noEmit' cannot be specified with option 'incremental'.
|
||||
"incremental": true
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS5053: Option 'noEmit' cannot be specified with option 'incremental'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
==== /a.ts (0 errors) ====
|
||||
const x = 10;
|
||||
|
||||
4
tests/baselines/reference/noEmitAndIncremental.symbols
Normal file
4
tests/baselines/reference/noEmitAndIncremental.symbols
Normal file
@ -0,0 +1,4 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
5
tests/baselines/reference/noEmitAndIncremental.types
Normal file
5
tests/baselines/reference/noEmitAndIncremental.types
Normal file
@ -0,0 +1,5 @@
|
||||
=== /a.ts ===
|
||||
const x = 10;
|
||||
>x : 10
|
||||
>10 : 10
|
||||
|
||||
10
tests/cases/compiler/noEmitAndComposite.ts
Normal file
10
tests/cases/compiler/noEmitAndComposite.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// @Filename: /a.ts
|
||||
const x = 10;
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"composite": true
|
||||
}
|
||||
}
|
||||
11
tests/cases/compiler/noEmitAndIncremental.ts
Normal file
11
tests/cases/compiler/noEmitAndIncremental.ts
Normal file
@ -0,0 +1,11 @@
|
||||
// @Filename: /a.ts
|
||||
const x = 10;
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"incremental": true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user