Skip to content

Commit 49ad1a3

Browse files
authored
Remove tsbuildInfo specification error now that we need it for non incremental scenarios as well and there is no way to disable it (#59960)
1 parent 02b07a1 commit 49ad1a3

File tree

5 files changed

+3
-29
lines changed

5 files changed

+3
-29
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4649,10 +4649,6 @@
46494649
"category": "Error",
46504650
"code": 5110
46514651
},
4652-
"Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.": {
4653-
"category": "Error",
4654-
"code": 5111
4655-
},
46564652

46574653
"Generates a sourcemap for each corresponding '.d.ts' file.": {
46584654
"category": "Message",

src/compiler/emitter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,7 @@ export function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): stri
499499
return buildInfoExtensionLess + Extension.TsBuildInfo;
500500
}
501501

502-
/** @internal */
503-
export function canEmitTsBuildInfo(options: CompilerOptions): boolean {
502+
function canEmitTsBuildInfo(options: CompilerOptions) {
504503
return isIncrementalCompilation(options) || !!options.tscBuild;
505504
}
506505

src/compiler/program.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
AsExpression,
99
BuilderProgram,
1010
CancellationToken,
11-
canEmitTsBuildInfo,
1211
canHaveDecorators,
1312
canHaveIllegalDecorators,
1413
chainDiagnosticMessages,
@@ -4341,12 +4340,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
43414340
}
43424341

43434342
const outputFile = options.outFile;
4344-
if (options.tsBuildInfoFile) {
4345-
if (!canEmitTsBuildInfo(options)) {
4346-
createDiagnosticForOptionName(Diagnostics.Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if_not_running_tsc_b, "tsBuildInfoFile");
4347-
}
4348-
}
4349-
else if (options.incremental && !outputFile && !options.configFilePath) {
4343+
if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) {
43504344
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
43514345
}
43524346

tests/baselines/reference/optionsTsBuildInfoFileWithoutIncrementalAndComposite.errors.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ declare const console: { log(msg: any): void; };
3434

3535
/home/src/tslibs/TS/Lib/tsc.js --composite false
3636
Output::
37-
tsconfig.json:6:5 - error TS5111: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.
38-
39-
6 "tsBuildInfoFile": "tsconfig.json.tsbuildinfo"
40-
   ~~~~~~~~~~~~~~~~~
41-
42-
43-
Found 1 error in tsconfig.json:6
44-
4537

4638

4739
//// [/home/src/workspaces/project/src/main.js]
@@ -52,4 +44,4 @@ exports.x = 10;
5244

5345

5446

55-
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
47+
exitCode:: ExitStatus.Success

0 commit comments

Comments
 (0)