Fix format of comment in paren of call expression in arrow expression (#3334)
parent
172d34e43d
commit
a02e3b3464
|
@ -683,7 +683,9 @@ function handleCommentInEmptyParens(text, enclosingNode, comment) {
|
|||
enclosingNode &&
|
||||
(((enclosingNode.type === "FunctionDeclaration" ||
|
||||
enclosingNode.type === "FunctionExpression" ||
|
||||
enclosingNode.type === "ArrowFunctionExpression" ||
|
||||
(enclosingNode.type === "ArrowFunctionExpression" &&
|
||||
(enclosingNode.body.type !== "CallExpression" ||
|
||||
enclosingNode.body.arguments.length === 0)) ||
|
||||
enclosingNode.type === "ClassMethod" ||
|
||||
enclosingNode.type === "ObjectMethod") &&
|
||||
enclosingNode.params.length === 0) ||
|
||||
|
|
|
@ -44,6 +44,9 @@ f(/* ... */);
|
|||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
let f = (/* ... */) => {};
|
||||
(function(/* ... */) {})(/* ... */);
|
||||
|
@ -72,4 +75,7 @@ f(a /* ... */);
|
|||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
|
||||
`;
|
||||
|
|
|
@ -23,3 +23,6 @@ f(/* ... */);
|
|||
f(a, /* ... */);
|
||||
f(a, /* ... */ b);
|
||||
f(/* ... */ a, b);
|
||||
|
||||
let f = () => import(a /* ... */);
|
||||
let f = () => doThing(a, /* ... */ b);
|
||||
|
|
Loading…
Reference in New Issue