Skip to content

Commit

Permalink
[release-5.6] Remove tsbuildInfo specification error now that we need…
Browse files Browse the repository at this point in the history
… it for non incremental scenarios as well and there is no way to disable it (#59960) (#60002)
  • Loading branch information
sheetalkamat authored Oct 8, 2024
1 parent 1f44dcf commit ff71692
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 @@ -4641,10 +4641,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) {
return buildInfoExtensionLess + Extension.TsBuildInfo;
}

/** @internal */
export function canEmitTsBuildInfo(options: CompilerOptions) {
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 @@ -4302,12 +4301,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 @@ -35,15 +35,7 @@ export const x = 10;

Output::
/lib/tsc --composite false --p src/project
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'.

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


Found 1 error in src/project/tsconfig.json:6

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


//// [/src/project/src/main.js]
Expand Down

0 comments on commit ff71692

Please sign in to comment.