Skip to content

Commit a98900c

Browse files
committed
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 a7e3374 commit a98900c

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
@@ -4641,10 +4641,6 @@
46414641
"category": "Error",
46424642
"code": 5110
46434643
},
4644-
"Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.": {
4645-
"category": "Error",
4646-
"code": 5111
4647-
},
46484644

46494645
"Generates a sourcemap for each corresponding '.d.ts' file.": {
46504646
"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) {
499499
return buildInfoExtensionLess + Extension.TsBuildInfo;
500500
}
501501

502-
/** @internal */
503-
export function canEmitTsBuildInfo(options: CompilerOptions) {
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,
@@ -4302,12 +4301,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
43024301
}
43034302

43044303
const outputFile = options.outFile;
4305-
if (options.tsBuildInfoFile) {
4306-
if (!canEmitTsBuildInfo(options)) {
4307-
createDiagnosticForOptionName(Diagnostics.Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if_not_running_tsc_b, "tsBuildInfoFile");
4308-
}
4309-
}
4310-
else if (options.incremental && !outputFile && !options.configFilePath) {
4304+
if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) {
43114305
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
43124306
}
43134307

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
@@ -35,15 +35,7 @@ export const x = 10;
3535

3636
Output::
3737
/lib/tsc --composite false --p src/project
38-
src/project/tsconfig.json:6:9 - error TS5111: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.
39-
40-
6 "tsBuildInfoFile": "tsconfig.json.tsbuildinfo"
41-
   ~~~~~~~~~~~~~~~~~
42-
43-
44-
Found 1 error in src/project/tsconfig.json:6
45-
46-
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
38+
exitCode:: ExitStatus.Success
4739

4840

4941
//// [/src/project/src/main.js]

0 commit comments

Comments
 (0)