From 664ad619b6f2d8060783c821da418ad09efc1bc7 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Fri, 22 Mar 2024 18:20:09 +0100 Subject: [PATCH] fix: Use proper library name check --- src/detectors/typeChecker/host.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/detectors/typeChecker/host.ts b/src/detectors/typeChecker/host.ts index 77f461a40..da26a50a3 100644 --- a/src/detectors/typeChecker/host.ts +++ b/src/detectors/typeChecker/host.ts @@ -251,7 +251,11 @@ export async function createVirtualCompilerHost( const moduleName = fileName.match(/\/types\/@ui5\/linter\/dynamic-types\/(.*)\.d\.ts/)?.[1]; if (moduleName) { const libraryNameCheck = moduleName?.replace(/\//g, "."); - const libraryName = SAPUI5_TYPES_FILES.find(($) => libraryNameCheck.startsWith($)); + if (libraryNameCheck.startsWith("sap.ui.core.") || !libraryNameCheck.startsWith("sap.")) { + // sap.ui.core is loaded by default + return; + } + const libraryName = SAPUI5_TYPES_FILES.find(($) => libraryNameCheck.startsWith($ + ".")); if (libraryName) { sourceText = `/// `; } else {