Skip to content

Commit

Permalink
Move check into function
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Apr 26, 2024
1 parent becd7d5 commit ed93ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import {
getTypeNode,
guessIndentation,
HasLocals,
hasProperty,
hasRecordedExternalHelpers,
HeritageClause,
Identifier,
Expand All @@ -188,6 +189,7 @@ import {
InferTypeNode,
InterfaceDeclaration,
InternalEmitFlags,
internalOptionDeclarations,
IntersectionTypeNode,
isAccessExpression,
isArray,
Expand Down Expand Up @@ -477,6 +479,7 @@ export function forEachEmittedFile<T>(
}

export function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions) {
if (some(internalOptionDeclarations, d => hasProperty(options, d.name))) return undefined; // disable buildinfo if an internal option is set
const configFile = options.configFilePath;
if (!isIncrementalCompilation(options)) return undefined;
if (options.tsBuildInfoFile) return options.tsBuildInfoFile;
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ import {
ImportOrExportSpecifier,
importSyntaxAffectsModuleResolution,
InternalEmitFlags,
internalOptionDeclarations,
inverseJsxOptionMap,
isAmbientModule,
isAnyImportOrReExport,
Expand Down Expand Up @@ -4806,7 +4805,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
}

function verifyProjectReferences() {
const buildInfoPath = !some(internalOptionDeclarations, d => hasProperty(options, d.name)) ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
const parentFile = parent && parent.sourceFile as JsonSourceFile;
Expand Down

0 comments on commit ed93ad4

Please sign in to comment.