getify / eslint-plugin-proper-arrows

ESLint rules to ensure proper arrow function definitions
MIT License
308 stars 14 forks source link

Prevent arrow functions that implicitly return arrow functions #14

Closed Dan503 closed 5 years ago

Dan503 commented 5 years ago

I'm not sure if this rule exists already or not.

I find it hard to read arrow functions that return arrow functions like this:

var x = (a,b) => () => a + b;

I think having a more explicit return is easier to read.

var x = (a,b) => {
  return () => a + b
};
getify commented 5 years ago

Yes that rule exists: "return" rule, "chained" mode. :)