src/main/comments.js/printLeadingComment
function printLeadingComment(commentPath, options) {
  const comment = commentPath.getValue();
  const contents = printComment(commentPath, options);
  /* istanbul ignore next */
  if (!contents) {
    return "";
  }
  const isBlock =
    options.printer.isBlockComment && options.printer.isBlockComment(comment);

  // Leading block comments should see if they need to stay on the
  // same line or not.
  if (isBlock) {
    const lineBreak = hasNewline(options.originalText, options.locEnd(comment))
      ? hasNewline(options.originalText, options.locStart(comment), {
          backwards: true,
        })
        ? hardline
        : line
      : " ";

    return concat([contents, lineBreak]);
  }

  return concat([contents, hardline]);
}