From 7ce59e9f48942213037b4a9d2f54cf435cecccee Mon Sep 17 00:00:00 2001 From: Benjamin Newman Date: Thu, 22 Apr 2021 16:04:04 -0400 Subject: [PATCH] fix: remove no reduce lint rule --- base.js | 1 + tests/base.js | 4 ++++ tests/test.js | 1 + 3 files changed, 6 insertions(+) diff --git a/base.js b/base.js index 87646f7..69b4c5f 100644 --- a/base.js +++ b/base.js @@ -81,5 +81,6 @@ module.exports = { }, ], 'unicorn/prefer-node-append': 0, + 'unicorn/no-reduce': 0, }, }; diff --git a/tests/base.js b/tests/base.js index 7ba4ed9..7c1c9f1 100644 --- a/tests/base.js +++ b/tests/base.js @@ -72,4 +72,8 @@ function readFile(filename, callback) { // unicorn/prefer-math-trunc var targetLength = 1; targetLength >>= 0; + +// unicorn/no-reduce +var array = [1, 2, 3] +var result = array.reduce((acc, current) => acc + current) `; diff --git a/tests/test.js b/tests/test.js index e7407f5..c821fc4 100644 --- a/tests/test.js +++ b/tests/test.js @@ -43,6 +43,7 @@ describe('rules', () => { expect(find(errors, { ruleId: 'unicorn/prefer-math-trunc' })).toBeUndefined(); expect(find(errors, { ruleId: 'no-restricted-syntax' })).toBeUndefined(); expect(find(errors, { ruleId: 'global-require' })).toBeUndefined(); + expect(find(errors, { ruleId: 'unicorn/no-reduce' })).toBeUndefined(); }); test('react', () => {