src/language-js/utils.js/hasLeadingOwnLineComment
function hasLeadingOwnLineComment(text, node, options) {
  if (isJSXNode(node)) {
    return hasNodeIgnoreComment(node);
  }

  const res =
    node.comments &&
    node.comments.some(
      (comment) => comment.leading && hasNewline(text, options.locEnd(comment))
    );
  return res;
}