requireArrowFunctions

Requires that arrow functions are used instead of anonymous function expressions in callbacks.

Type: Boolean

Value: true

Version: ES6

Example

"requireArrowFunctions": true
Valid
// arrow function
[1, 2, 3].map((x) => {
    return x * x;
});
// function declaration
function a(n) { return n + 1; }
// getter/setter
var x = { get y() {}, set y(y) {} }
// object shorthand
var x = { bar() {} }
// class method
class Foo { bar() {} }
// function expression in a return statement
function a(x) {
    return function(x) { return x };
};
// function expression in a variable declaration
var a = function(x) { return x };
Invalid
// function expression in a callback
[1, 2, 3].map(function (x) {
    return x * x;
});
Rule source
Test source