Skip to content

Commit

Permalink
chore: Add packageRule logging to matchPackagePrefixes and excludePac…
Browse files Browse the repository at this point in the history
…kagePrefixes warnings (#29261)
  • Loading branch information
TWiStErRob committed May 26, 2024
1 parent e69a5f8 commit 3110afc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/util/package-rules/package-prefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { Matcher } from './base';
export class PackagePrefixesMatcher extends Matcher {
override matches(
{ depName, packageName }: PackageRuleInputConfig,
{ matchPackagePrefixes }: PackageRule,
packageRule: PackageRule,
): boolean | null {
const { matchPackagePrefixes } = packageRule;
if (is.undefined(matchPackagePrefixes)) {
return null;
}
Expand All @@ -24,7 +25,7 @@ export class PackagePrefixesMatcher extends Matcher {
}
if (matchPackagePrefixes.some((prefix) => depName.startsWith(prefix))) {
logger.once.warn(
{ packageName, depName },
{ packageRule, packageName, depName },
'Use matchDepPatterns instead of matchPackagePrefixes',
);
return true;
Expand Down Expand Up @@ -53,7 +54,7 @@ export class PackagePrefixesMatcher extends Matcher {
}
if (excludePackagePrefixes.some((prefix) => depName.startsWith(prefix))) {
logger.once.warn(
{ packageName, depName },
{ packageRule, packageName, depName },
'Use excludeDepPatterns instead of excludePackagePrefixes',
);
return true;
Expand Down

0 comments on commit 3110afc

Please sign in to comment.