-
Notifications
You must be signed in to change notification settings - Fork 14
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
Should => { return
be bad text?
#790
Comments
All of the existing 33 cases should be converted, they will be more readable without the |
I could imagine having a filter arrow function where it's one expression to return BUT really needs to take up multiple lines. I find the braces to be helpful for multi-line arrow functions, but I would prefer the one-liners (brace, space, |
Should |
=> { return
be bad text? => { return
be bad text?
=> { return
be bad text?=> { return
be bad text?
Here's some lint rules that may help us: |
@jonathanolson said:
Something like this: arg => {
return expression1 && expression2 && expression3 && .... && expressionN;
} can be written without curly braces as: arg => ( expression1 && expression2 && expression3 && .... && expressionN ) |
From this issue will investigate two lint rules:
|
There were ~160 issues with I looked into using The rules are now committed and lint is passing. Closing |
IMO one lined arrow functions that return something should not use the curly braces and
return
keyword, because it is simpler to just havearg => arg === 3
instead ofarg => { return arg === 3; }
.If it is a more complex arrow function, then perhaps it can be on more than one line, and then include those pieces. There are currently 33 usages of
=> { return
.Marking for developer meeting.
The text was updated successfully, but these errors were encountered: