You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/rules/array-callback-return.md
+43-2
Original file line number
Diff line number
Diff line change
@@ -92,10 +92,13 @@ var bar = foo.map(node => node.getAttribute("id"));
92
92
93
93
## Options
94
94
95
-
This rule accepts a configuration object with two options:
95
+
This rule accepts a configuration object with three options:
96
96
97
97
*`"allowImplicit": false` (default) When set to `true`, allows callbacks of methods that require a return value to implicitly return `undefined` with a `return` statement containing no expression.
98
98
*`"checkForEach": false` (default) When set to `true`, rule will also report `forEach` callbacks that return a value.
99
+
*`"allowVoid": false` (default) When set to `true`, allows `void` in `forEach` callbacks, so rule will not report the return value with a `void` operator.
100
+
101
+
**Note:**`{ "allowVoid": true }` works only if `checkForEach` option is set to `true`.
99
102
100
103
### allowImplicit
101
104
@@ -122,7 +125,7 @@ Examples of **incorrect** code for the `{ "checkForEach": true }` option:
0 commit comments