-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow one line arrow functions #22
Comments
jhnns
added a commit
that referenced
this issue
Aug 26, 2018
See also #22 BREAKING CHANGE: This adds a new rule and might break existing tests
jhnns
added a commit
that referenced
this issue
Aug 26, 2018
See also #22 BREAKING CHANGE: This adds a new rule and might break existing tests
I prefer a consistent style. Either we use function declarations or arrow functions for everything because refactoring becomes painful if we have both styles. Every time a one-line arrow function becomes a two-line function, I would need to refactor it to a function declaration. So closing this in favor of #23 |
jhnns
added a commit
that referenced
this issue
Aug 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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:
We should do that.
The text was updated successfully, but these errors were encountered: