From 0c30036c98ef32adfd0e275a8a30cddce8051431 Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 2 Nov 2019 10:58:07 -0500 Subject: [PATCH] fix(rules): group rule errors to trigger correct failure (#114) --- src/rule/SchemaRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rule/SchemaRule.ts b/src/rule/SchemaRule.ts index 1fb8244..5209ca4 100644 --- a/src/rule/SchemaRule.ts +++ b/src/rule/SchemaRule.ts @@ -57,7 +57,7 @@ export class SchemaRule implements RuleData, Visitor { if (filter(node)) { ctx.logger.debug({ item: node }, 'checking item'); if (!check(node) && hasItems(check.errors)) { - ctx.error(...Array.from(check.errors).map(friendlyError)); + errors.push(...check.errors.map(friendlyError)); } } else { ctx.logger.debug({ errors: filter.errors, item: node }, 'skipping item');