From b49b889c61d9d25f699c72de3ad6d70947205c2c Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 9 Nov 2019 18:01:40 -0600 Subject: [PATCH] lint: fix lint issues --- src/rule/index.ts | 4 ++-- src/visitor/VisitorContext.ts | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/rule/index.ts b/src/rule/index.ts index 7eb4251..6a1e6b3 100644 --- a/src/rule/index.ts +++ b/src/rule/index.ts @@ -205,8 +205,8 @@ export async function visitRules(ctx: VisitorContext, rules: Array, data: let itemIndex = 0; for (const item of items) { ctx.visitData = { - itemIndex, - rule, + itemIndex, + rule, }; const itemResult = cloneDeep(item); const ruleResult = await rule.visit(ctx, itemResult); diff --git a/src/visitor/VisitorContext.ts b/src/visitor/VisitorContext.ts index 66b0532..74c7161 100644 --- a/src/visitor/VisitorContext.ts +++ b/src/visitor/VisitorContext.ts @@ -67,15 +67,13 @@ export class VisitorContext implements VisitorContextOptions, VisitorResult { public mergeResult(other: VisitorResult, data: any = {}): this { this.changeBuffer.push(...other.changes); - this.errorBuffer.push(...other.errors.map((err) => { - return { - ...err, - data: { - ...err.data, - ...data, - }, - }; - })); + this.errorBuffer.push(...other.errors.map((err) => ({ + ...err, + data: { + ...err.data, + ...data, + }, + }))); return this; }