This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Description
We currently disallow arrow functions in favor of a consistent function style. They are only allowed within other functions. However, if the function returns immediately (which is very common in functional programming), it is more readable if we use arrow functions:
// Good
const bla = () => true;
// Good
const bla = () => ({
prop: true
});
// Bad
const bla = () => {
return true;
};
// Bad
const bla = () => {
const blub = true;
return blub;
};
See also discussion: eslint/eslint#7765
With the https://github.com/TristonJ/eslint-plugin-prefer-arrow plugin, it's finally possible to define that rule:
"func-style": [
"error",
"declaration",
{
"allowArrowFunctions": true
}
],
"prefer-arrow/prefer-arrow-functions": [
"error",
{
"singleReturnOnly": true
}
]
We should do that.