-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Add section on nested/multiline ternaries #673
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
Conversation
: value1 > value2 ? "baz" : null; | ||
|
||
//better | ||
const maybeNull = value1 > value2 ? "baz" : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per our "quotes" rule, all the non-bad ones should use single quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
In this node style guide they encourage multi-line ternaries, although no explanation is given why. https://github.com/felixge/node-style-guide#use-multi-line-ternary-operator |
Can we make this link to the relevant eslint rule(s)? |
linked to one rule, did you have others in mind? |
I think that's it :-) |
Seems like the discussion above about multiline ternaries has been resolved? Please share any further thoughts on the subject; I'd like to merge this within the next day or two. |
No additional thoughts here. |
@bgvianyc Would you mind one last rebase on this? I think it's time to merge it. |
How do you want it rebased? I only see one commit now. |
@bgvianyc just stacked on top of latest master so i can fast-forward merge it :-) |
add link to the relevant eslint rule
@ljharb done |
As per this issue: #671