Parens are needed unless it's a logical expression
This commit is contained in:
parent
f9c923b87f
commit
382c0d9c1a
@ -97,6 +97,11 @@ export function Binary(node, parent) {
|
||||
if (parentPos > nodePos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Logical expressions with the same precedence don't need parens.
|
||||
if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user