Skip to content

Commit

Permalink
Remove tsbuildInfo specification error now that we need it for non in…
Browse files Browse the repository at this point in the history
…cremental scenarios as well and there is no way to disable it (#59960)
  • Loading branch information
sheetalkamat authored Sep 18, 2024
1 parent 02b07a1 commit 49ad1a3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 29 deletions.
4 changes: 0 additions & 4 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4649,10 +4649,6 @@
"category": "Error",
"code": 5110
},
"Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.": {
"category": "Error",
"code": 5111
},

"Generates a sourcemap for each corresponding '.d.ts' file.": {
"category": "Message",
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,7 @@ export function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): stri
return buildInfoExtensionLess + Extension.TsBuildInfo;
}

/** @internal */
export function canEmitTsBuildInfo(options: CompilerOptions): boolean {
function canEmitTsBuildInfo(options: CompilerOptions) {
return isIncrementalCompilation(options) || !!options.tscBuild;
}

Expand Down
8 changes: 1 addition & 7 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
AsExpression,
BuilderProgram,
CancellationToken,
canEmitTsBuildInfo,
canHaveDecorators,
canHaveIllegalDecorators,
chainDiagnosticMessages,
Expand Down Expand Up @@ -4341,12 +4340,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
}

const outputFile = options.outFile;
if (options.tsBuildInfoFile) {
if (!canEmitTsBuildInfo(options)) {
createDiagnosticForOptionName(Diagnostics.Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if_not_running_tsc_b, "tsBuildInfoFile");
}
}
else if (options.incremental && !outputFile && !options.configFilePath) {
if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ declare const console: { log(msg: any): void; };

/home/src/tslibs/TS/Lib/tsc.js --composite false
Output::
tsconfig.json:6:5 - error TS5111: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'.

6 "tsBuildInfoFile": "tsconfig.json.tsbuildinfo"
   ~~~~~~~~~~~~~~~~~


Found 1 error in tsconfig.json:6



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



exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
exitCode:: ExitStatus.Success

0 comments on commit 49ad1a3

Please sign in to comment.