typo: ident -> indent
parent
7162e1ecc8
commit
158edf5388
|
@ -343,8 +343,8 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid indenting sub-expressions in some cases where the first sub-expression is already
|
// Avoid indenting sub-expressions in some cases where the first sub-expression is already
|
||||||
// idented accordingly. We should ident sub-expressions where the first case isn't idented.
|
// indented accordingly. We should indent sub-expressions where the first case isn't indented.
|
||||||
const shouldNotIdent =
|
const shouldNotIndent =
|
||||||
parent.type === "ReturnStatement" ||
|
parent.type === "ReturnStatement" ||
|
||||||
(parent.type === "JSXExpressionContainer" &&
|
(parent.type === "JSXExpressionContainer" &&
|
||||||
parentParent.type === "JSXAttribute") ||
|
parentParent.type === "JSXAttribute") ||
|
||||||
|
@ -353,7 +353,7 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
(parent.type === "ConditionalExpression" &&
|
(parent.type === "ConditionalExpression" &&
|
||||||
parentParent.type !== "ReturnStatement");
|
parentParent.type !== "ReturnStatement");
|
||||||
|
|
||||||
const shouldIdentIfInlining =
|
const shouldIndentIfInlining =
|
||||||
parent.type === "AssignmentExpression" ||
|
parent.type === "AssignmentExpression" ||
|
||||||
parent.type === "VariableDeclarator" ||
|
parent.type === "VariableDeclarator" ||
|
||||||
parent.type === "ObjectProperty" ||
|
parent.type === "ObjectProperty" ||
|
||||||
|
@ -363,9 +363,9 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
isBinaryish(n.left) && util.shouldFlatten(n.operator, n.left.operator);
|
isBinaryish(n.left) && util.shouldFlatten(n.operator, n.left.operator);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
shouldNotIdent ||
|
shouldNotIndent ||
|
||||||
(shouldInlineLogicalExpression(n) && !samePrecedenceSubExpression) ||
|
(shouldInlineLogicalExpression(n) && !samePrecedenceSubExpression) ||
|
||||||
(!shouldInlineLogicalExpression(n) && shouldIdentIfInlining)
|
(!shouldInlineLogicalExpression(n) && shouldIndentIfInlining)
|
||||||
) {
|
) {
|
||||||
return group(concat(parts));
|
return group(concat(parts));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue