diff --git a/src/linter/linter.ts b/src/linter/linter.ts index 5947518c..812cea64 100644 --- a/src/linter/linter.ts +++ b/src/linter/linter.ts @@ -314,6 +314,11 @@ function buildPatterns(patterns: string[]) { pattern += "**/*"; } + // Remove leading "./" from the pattern, as it otherwise would not match + if (pattern.startsWith("./")) { + pattern = pattern.slice(2); + } + return new Minimatch(pattern, {flipNegate: true}); }); } diff --git a/test/lib/linter/linter.ts b/test/lib/linter/linter.ts index 5deea096..dafbd754 100644 --- a/test/lib/linter/linter.ts +++ b/test/lib/linter/linter.ts @@ -162,7 +162,7 @@ test.serial("lint: Ignore files from library.with.custom.paths", async (t) => { ignorePatterns: [ "src/", "!src/main/", - "ui5.yaml", + "./ui5.yaml", // Relative paths starting with "./" should match the same as without it ], });