Skip to content

Commit f494cc6

Browse files
committed
Move check into function
1 parent f4f3a20 commit f494cc6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/compiler/emitter.ts

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ import {
170170
getTypeNode,
171171
guessIndentation,
172172
HasLocals,
173+
hasProperty,
173174
hasRecordedExternalHelpers,
174175
HeritageClause,
175176
Identifier,
@@ -188,6 +189,7 @@ import {
188189
InferTypeNode,
189190
InterfaceDeclaration,
190191
InternalEmitFlags,
192+
internalOptionDeclarations,
191193
IntersectionTypeNode,
192194
isAccessExpression,
193195
isArray,
@@ -477,6 +479,7 @@ export function forEachEmittedFile<T>(
477479
}
478480

479481
export function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions) {
482+
if (some(internalOptionDeclarations, d => hasProperty(options, d.name))) return undefined; // disable buildinfo if an internal option is set
480483
const configFile = options.configFilePath;
481484
if (!isIncrementalCompilation(options)) return undefined;
482485
if (options.tsBuildInfoFile) return options.tsBuildInfoFile;

src/compiler/program.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ import {
171171
ImportOrExportSpecifier,
172172
importSyntaxAffectsModuleResolution,
173173
InternalEmitFlags,
174-
internalOptionDeclarations,
175174
inverseJsxOptionMap,
176175
isAmbientModule,
177176
isAnyImportOrReExport,
@@ -4796,7 +4795,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
47964795
}
47974796

47984797
function verifyProjectReferences() {
4799-
const buildInfoPath = !some(internalOptionDeclarations, d => hasProperty(options, d.name)) ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
4798+
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
48004799
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
48014800
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
48024801
const parentFile = parent && parent.sourceFile as JsonSourceFile;

0 commit comments

Comments
 (0)