Skip to content

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

Merged
merged 1 commit into from
Feb 2, 2016
Merged

Conversation

bgits
Copy link
Contributor

@bgits bgits commented Jan 11, 2016

As per this issue: #671

: value1 > value2 ? "baz" : null;

//better
const maybeNull = value1 > value2 ? "baz" : null;
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@bgits
Copy link
Contributor Author

bgits commented Jan 12, 2016

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

@ljharb
Copy link
Collaborator

ljharb commented Jan 13, 2016

Can we make this link to the relevant eslint rule(s)?

@bgits
Copy link
Contributor Author

bgits commented Jan 13, 2016

linked to one rule, did you have others in mind?

@ljharb
Copy link
Collaborator

ljharb commented Jan 14, 2016

I think that's it :-)

@ljharb
Copy link
Collaborator

ljharb commented Jan 14, 2016

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.

@bgits
Copy link
Contributor Author

bgits commented Jan 14, 2016

No additional thoughts here.

@ljharb
Copy link
Collaborator

ljharb commented Feb 2, 2016

@bgvianyc Would you mind one last rebase on this? I think it's time to merge it.

@bgits
Copy link
Contributor Author

bgits commented Feb 2, 2016

How do you want it rebased? I only see one commit now.

@ljharb
Copy link
Collaborator

ljharb commented Feb 2, 2016

@bgvianyc just stacked on top of latest master so i can fast-forward merge it :-)

add link to the relevant eslint rule
@bgits
Copy link
Contributor Author

bgits commented Feb 2, 2016

@ljharb done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants