src/language-js/comments.js/handleCommentInEmptyParens
function handleCommentInEmptyParens(text, enclosingNode, comment, options) {
  if (
    getNextNonSpaceNonCommentCharacter(text, comment, options.locEnd) !== ")"
  ) {
    return false;
  }

  // Only add dangling comments to fix the case when no params are present,
  // i.e. a function without any argument.
  if (
    enclosingNode &&
    ((isRealFunctionLikeNode(enclosingNode) &&
      // `params` vs `parameters` - see https://github.com/babel/babel/issues/9231
      (enclosingNode.params || enclosingNode.parameters).length === 0) ||
      ((enclosingNode.type === "CallExpression" ||
        enclosingNode.type === "OptionalCallExpression" ||
        enclosingNode.type === "NewExpression") &&
        enclosingNode.arguments.length === 0))
  ) {
    addDanglingComment(enclosingNode, comment);
    return true;
  }
  if (
    enclosingNode &&
    enclosingNode.type === "MethodDefinition" &&
    enclosingNode.value.params.length === 0
  ) {
    addDanglingComment(enclosingNode.value, comment);
    return true;
  }
  return false;
}