Require arrow functions to use a block statement (explicit return).
Why enable this rule? Arrow functions' syntax can cause maintenance issues:
undefined
, unless you remember to add an
explicit return
.(name) => {id: name}
is interpreted as a longhand arrow function with the
label id:
.Type: Boolean
Value: true
Version: ES6
"disallowShorthandArrowFunctions": true
// block statement
evens.map(v => {
return v + 1;
});
// single expression
evens.map(v => v + 1);