diff --git a/lib/util/package-rules/index.ts b/lib/util/package-rules/index.ts index 43c8acfcd71a32..9484d09dd5f7df 100644 --- a/lib/util/package-rules/index.ts +++ b/lib/util/package-rules/index.ts @@ -29,7 +29,7 @@ function matchesRule( matchApplied = true; if (!is.truthy(isMatch)) { - positiveMatch = false; + return false; } } @@ -38,11 +38,6 @@ function matchesRule( positiveMatch = true; } - // nothing has been matched - if (!positiveMatch) { - return false; - } - // excludes for (const groupExcludes of matchers) { const isExclude = matcherOR( diff --git a/lib/util/package-rules/utils.ts b/lib/util/package-rules/utils.ts index 629486271523a3..7f48742c5119fa 100644 --- a/lib/util/package-rules/utils.ts +++ b/lib/util/package-rules/utils.ts @@ -8,7 +8,6 @@ export function matcherOR( inputConfig: PackageRuleInputConfig, packageRule: PackageRule ): boolean | null { - let positiveMatch = false; let matchApplied = false; for (const matcher of groupMatchers) { let isMatch; @@ -29,10 +28,10 @@ export function matcherOR( matchApplied = true; if (is.truthy(isMatch)) { - positiveMatch = true; + return true; } } - return matchApplied ? positiveMatch : null; + return matchApplied ? false : null; } export function massagePattern(pattern: string): string {