An arrow function expression is a compact alternative to anonymous function.
(c) MDN
🐊Putout plugin convert anonymous to arrow function.
npm i @putout/plugin-convert-to-arrow-function
{
"rules": {
"convert-to-arrow-function": "on"
}
}
module.exports = function(a, b) {
};
function x() {
return function(a) {
return b;
};
}
module.exports = (a, b) => {
};
function x() {
return (a) => {
return b;
};
}
MIT