From 65bbf45319e053f045c57a45a19e2f1a9c17f5cf Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 5 May 2021 17:46:34 +0200 Subject: [PATCH] fix(validation): only warn when extending group in rules (#9871) --- lib/config/validation.spec.ts | 1 + lib/config/validation.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 5b5487da984f36..5d337956ffbef3 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -604,6 +604,7 @@ describe(getName(), () => { }); it('warns on nested group packageRules', async () => { const config = { + extends: ['group:fortawesome'], packageRules: [ { automerge: true, diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 8e9b086a12a715..93c13065b5d730 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -256,7 +256,10 @@ export async function validateConfig( const tzRe = /^:timezone\((.+)\)$/; for (const subval of val) { if (is.string(subval)) { - if (subval.startsWith('group:')) { + if ( + parentName === 'packageRules' && + subval.startsWith('group:') + ) { warnings.push({ topic: 'Configuration Warning', message: `${currentPath}: you should not extend "group:" presets`,