Skip to content

Commit 7100648

Browse files
committed
fix: breack chain method call if too long
1 parent 520e06a commit 7100648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/print/MemberExpression.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import {
55
wrapExpressionIfNeeded
66
} from "../util/index.js";
77

8-
const { group } = doc.builders;
8+
const { group, indent, softline } = doc.builders;
99

1010
const printMemberExpression = (node, path, print) => {
1111
node[EXPRESSION_NEEDED] = false;
1212
node[STRING_NEEDS_QUOTES] = true;
1313
const parts = [path.call(print, "object")];
14-
parts.push(node.computed ? "[" : ".");
14+
parts.push(node.computed ? "[" : indent([softline, "."]));
1515
parts.push(path.call(print, "property"));
1616
if (node.computed) {
1717
parts.push("]");

0 commit comments

Comments
 (0)