Skip to content

Commit 16bd4e5

Browse files
AbhiPrasadiker-barriocanal
authored andcommitted
feat(eslint-config): Enable array-callback-return rule (#4229)
Docs: https://eslint.org/docs/rules/array-callback-return Make sure that we are returning in the callbacks passed into `.map`, `.filter` and `.reduce`. If we are not, we should be using `.forEach` or an explicit for loop. Co-authored-by: iker barriocanal <[email protected]>
1 parent 092d54d commit 16bd4e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/eslint-config-sdk/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,5 +234,10 @@ module.exports = {
234234

235235
// Make sure for in loops check for properties
236236
'guard-for-in': 'error',
237+
238+
// Make sure that we are returning in the callbacks passed into `.map`,
239+
// `.filter` and `.reduce`. If we are not, we should be using
240+
// `.forEach()` or an explicit for loop.
241+
'array-callback-return': ['error', { allowImplicit: true }],
237242
},
238243
};

0 commit comments

Comments
 (0)