Skip to content

Commit

Permalink
fix(validation): only warn when extending group in rules (#9871)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored May 5, 2021
1 parent b974ba0 commit 65bbf45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/config/validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ describe(getName(), () => {
});
it('warns on nested group packageRules', async () => {
const config = {
extends: ['group:fortawesome'],
packageRules: [
{
automerge: true,
Expand Down
5 changes: 4 additions & 1 deletion lib/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit 65bbf45

Please sign in to comment.