This reverts commit 12046cd01b
.
master
parent
12046cd01b
commit
cb5e1db4a5
|
@ -243,8 +243,7 @@ function formatTernaryOperator(path, options, print, operatorOptions) {
|
|||
(operatorOpts.shouldCheckJsx && isJSXNode(n[operatorOpts.testNode])) ||
|
||||
isJSXNode(n[operatorOpts.consequentNode]) ||
|
||||
isJSXNode(n[operatorOpts.alternateNode]) ||
|
||||
conditionalExpressionChainContainsJSX(lastConditionalParent) ||
|
||||
firstNonConditionalParent.type === "JSXExpressionContainer"
|
||||
conditionalExpressionChainContainsJSX(lastConditionalParent)
|
||||
) {
|
||||
jsxMode = true;
|
||||
forceNoIndent = true;
|
||||
|
|
|
@ -240,16 +240,6 @@ cable ? (
|
|||
)
|
||||
) : null}
|
||||
</div>;
|
||||
|
||||
// This ConditionalExpression prints in JSX mode because the first
|
||||
// non-conditional parent is a JSX expression container.
|
||||
<div>
|
||||
{data.length > 1 ? (
|
||||
"This is a really long non-jsx element inside of a ternary-operator that in turn is inside of a JSX expression container."
|
||||
) : (
|
||||
"This is string however, is not as long as the previous one."
|
||||
)}
|
||||
</div>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// There are two ways to print ConditionalExpressions: "normal mode" and
|
||||
// "JSX mode". This is normal mode (when breaking):
|
||||
|
@ -395,16 +385,6 @@ cable ? (
|
|||
) : null}
|
||||
</div>;
|
||||
|
||||
// This ConditionalExpression prints in JSX mode because the first
|
||||
// non-conditional parent is a JSX expression container.
|
||||
<div>
|
||||
{data.length > 1 ? (
|
||||
"This is a really long non-jsx element inside of a ternary-operator that in turn is inside of a JSX expression container."
|
||||
) : (
|
||||
"This is string however, is not as long as the previous one."
|
||||
)}
|
||||
</div>;
|
||||
|
||||
`;
|
||||
|
||||
exports[`expression.js 1`] = `
|
||||
|
|
|
@ -129,13 +129,3 @@ cable ? (
|
|||
)
|
||||
) : null}
|
||||
</div>;
|
||||
|
||||
// This ConditionalExpression prints in JSX mode because the first
|
||||
// non-conditional parent is a JSX expression container.
|
||||
<div>
|
||||
{data.length > 1 ? (
|
||||
"This is a really long non-jsx element inside of a ternary-operator that in turn is inside of a JSX expression container."
|
||||
) : (
|
||||
"This is string however, is not as long as the previous one."
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue