Dont filter type aquisition when its not enabled (#59351)

This commit is contained in:
Sheetal Nandi 2024-07-18 14:16:07 -07:00 committed by GitHub
parent 121c5dd36b
commit f8a7913c1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1077,7 +1077,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
}
protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition {
if (!newTypeAcquisition || !newTypeAcquisition.include) {
if (!newTypeAcquisition.enable || !newTypeAcquisition.include) {
// Nothing to filter out, so just return as-is
return newTypeAcquisition;
}
@ -1627,8 +1627,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
}
protected removeExistingTypings(include: string[]): string[] {
if (!include.length) return include;
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
return include.filter(i => !existing.includes(i));
return filter(include, i => !existing.includes(i));
}
private updateGraphWorker() {