parent
c63e21b52b
commit
bb232d48a3
|
@ -196,6 +196,7 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
case "BinaryExpression":
|
case "BinaryExpression":
|
||||||
case "LogicalExpression": {
|
case "LogicalExpression": {
|
||||||
const parent = path.getParentNode();
|
const parent = path.getParentNode();
|
||||||
|
const parentParent = path.getParentNode(1);
|
||||||
const isInsideParenthesis =
|
const isInsideParenthesis =
|
||||||
n !== parent.body &&
|
n !== parent.body &&
|
||||||
(parent.type === "IfStatement" ||
|
(parent.type === "IfStatement" ||
|
||||||
|
@ -230,6 +231,8 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
parent.type === "VariableDeclarator" ||
|
parent.type === "VariableDeclarator" ||
|
||||||
shouldInlineLogicalExpression(n) ||
|
shouldInlineLogicalExpression(n) ||
|
||||||
parent.type === "ReturnStatement" ||
|
parent.type === "ReturnStatement" ||
|
||||||
|
(parent.type === "JSXExpressionContainer" &&
|
||||||
|
parentParent.type === "JSXAttribute") ||
|
||||||
(n === parent.body && parent.type === "ArrowFunctionExpression") ||
|
(n === parent.body && parent.type === "ArrowFunctionExpression") ||
|
||||||
(n !== parent.body && parent.type === "ForStatement")
|
(n !== parent.body && parent.type === "ForStatement")
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -120,6 +120,37 @@ this.steps = steps || [
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`jsx_parent.js 1`] = `
|
||||||
|
<div
|
||||||
|
src={
|
||||||
|
!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty
|
||||||
|
}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty}
|
||||||
|
</div>;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
<div
|
||||||
|
src={
|
||||||
|
!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty
|
||||||
|
}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty}
|
||||||
|
</div>;
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`short-right.js 1`] = `
|
exports[`short-right.js 1`] = `
|
||||||
this._cumulativeHeights &&
|
this._cumulativeHeights &&
|
||||||
Math.abs(
|
Math.abs(
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<div
|
||||||
|
src={
|
||||||
|
!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty
|
||||||
|
}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{!isJellyfishEnabled &&
|
||||||
|
diffUpdateMessageInput != null &&
|
||||||
|
this.state.isUpdateMessageEmpty}
|
||||||
|
</div>;
|
Loading…
Reference in New Issue