diff --git a/src/core/utils.ts b/src/core/utils.ts index b9bf4da6..df1084a2 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -58,8 +58,10 @@ export function isEmpty(value: any) { export function matchGlobs(filepath: string, globs: string[]) { for (const glob of globs) { - if (minimatch(slash(filepath), glob)) - return true + const isNegated = glob.startsWith('!') + const match = minimatch(slash(filepath), isNegated ? glob.slice(1) : glob) + if (match) + return !isNegated } return false }