Break nested calls (#517)
If there's a break inside of a call, we want to force it in the group, otherwise it may get the indentation wrong. See the real-world use case in #513 Fixes #513
This commit is contained in:
1 parent
8bc3c617a0
commit
d3fa519492
4 files changed
+20
-1
No files matched your search
+2
-1
@@ -1768,7 +1768,8 @@ function printArgumentsList(path, options, print) {
|
||||
ifBreak(options.trailingComma ? "," : ""),
|
||||
softline,
|
||||
")"
|
||||
])
|
||||
]),
|
||||
{ shouldBreak: printed.some(willBreak) }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
exports[`test break.js 1`] = `
|
||||
"h(f(g(() => {
|
||||
a
|
||||
})))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
h(
|
||||
f(
|
||||
g(() => {
|
||||
a;
|
||||
})
|
||||
)
|
||||
);
|
||||
"
|
||||
`;
|
||||
@@ -0,0 +1,3 @@
|
||||
h(f(g(() => {
|
||||
a
|
||||
})))
|
||||
@@ -0,0 +1 @@
|
||||
run_spec(__dirname);
|
||||
Reference in new issue
Block a user