Files
test-repo/tests/jsx/logical-expression.js
T
Stephen Scott 3ed2bae1b4 Improve JSX ternary formatting
* Now JSX-mode ternaries only break if they need to. 
* Only the outermost ternary in a chain of JSX-mode ternaries will become a group.
* We don't wrap null in parens when breaking JSX-mode ternaries.

This commit also improves the test coverage and explanation in tests/jsx/conditional-expression.js.
2017-07-13 10:21:58 -06:00

24 lines
211 B
JavaScript

<div>
{a || "b"}
</div>;
<div>
{a && "b"}
</div>;
<div>
{a || <span></span>}
</div>;
<div>
{a && <span></span>}
</div>;
<div>
{a && <span>
<div>
<div></div>
</div>
</span>}
</div>;