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 #513master
parent
8bc3c617a0
commit
d3fa519492
|
@ -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);
|
Loading…
Reference in New Issue