Force break if comment in return argument (#3665)
* Force break if comment in return argument * add test casemaster
parent
a3b973c245
commit
aac38fca49
|
@ -761,8 +761,8 @@ function printPathNoParens(path, options, print, args) {
|
|||
parts.push(
|
||||
concat([
|
||||
" (",
|
||||
indent(concat([softline, path.call(print, "argument")])),
|
||||
line,
|
||||
indent(concat([hardline, path.call(print, "argument")])),
|
||||
hardline,
|
||||
")"
|
||||
])
|
||||
);
|
||||
|
|
|
@ -55,9 +55,55 @@ exports[`comment.js 1`] = `
|
|||
function f() {
|
||||
return /* a */;
|
||||
}
|
||||
|
||||
function x() {
|
||||
return func2
|
||||
//comment
|
||||
.bar();
|
||||
}
|
||||
|
||||
function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
}
|
||||
|
||||
fn(function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
});
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
function f() {
|
||||
return /* a */;
|
||||
}
|
||||
|
||||
function x() {
|
||||
return (
|
||||
func2
|
||||
//comment
|
||||
.bar()
|
||||
);
|
||||
}
|
||||
|
||||
function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
}
|
||||
|
||||
fn(function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
});
|
||||
|
||||
`;
|
||||
|
|
|
@ -1,3 +1,25 @@
|
|||
function f() {
|
||||
return /* a */;
|
||||
}
|
||||
|
||||
function x() {
|
||||
return func2
|
||||
//comment
|
||||
.bar();
|
||||
}
|
||||
|
||||
function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
}
|
||||
|
||||
fn(function f() {
|
||||
return (
|
||||
foo
|
||||
// comment
|
||||
.bar()
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue