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

  return hasComment(node, CommentCheckFlags.Leading, (comment) =>
    hasNewline(text, locEnd(comment))
  );
}