parent
3d964b18bb
commit
c63e21b52b
|
@ -2763,7 +2763,7 @@ function canPrintParamsWithoutParens(node) {
|
|||
!node.rest &&
|
||||
node.params[0].type === "Identifier" &&
|
||||
!node.params[0].typeAnnotation &&
|
||||
!node.params[0].comments &&
|
||||
!hasBlockComments(node.params[0]) &&
|
||||
!node.params[0].optional &&
|
||||
!node.predicate &&
|
||||
!node.returnType
|
||||
|
@ -4089,6 +4089,13 @@ function hasDanglingComments(node) {
|
|||
node.comments.some(comment => !comment.leading && !comment.trailing);
|
||||
}
|
||||
|
||||
function hasBlockComments(node) {
|
||||
return node.comments &&
|
||||
node.comments.some(comment =>
|
||||
comment.type === "Block" || comment.type === "CommentBlock"
|
||||
);
|
||||
}
|
||||
|
||||
function removeLines(doc) {
|
||||
// Force this doc into flat mode by statically converting all
|
||||
// lines into spaces (or soft lines into nothing). Hard lines
|
||||
|
|
|
@ -235,11 +235,15 @@ function a(/* comment */) {} // comment
|
|||
function b() {} // comment
|
||||
function c(/* comment */ argA, argB, argC) {} // comment
|
||||
call((/*object*/ row) => {});
|
||||
KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
|
||||
<div />
|
||||
));
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
function a(/* comment */) {} // comment
|
||||
function b() {} // comment
|
||||
function c(/* comment */ argA, argB, argC) {} // comment
|
||||
call((/*object*/ row) => {});
|
||||
KEYPAD_NUMBERS.map(num => <div />); // Buttons 0-9
|
||||
|
||||
`;
|
||||
|
||||
|
|
|
@ -2,3 +2,6 @@ function a(/* comment */) {} // comment
|
|||
function b() {} // comment
|
||||
function c(/* comment */ argA, argB, argC) {} // comment
|
||||
call((/*object*/ row) => {});
|
||||
KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
|
||||
<div />
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue