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 committed Sep 18, 2024
1 parent a7e3374 commit a98900c
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 a98900c

Please sign in to comment.