src/language-js/print/comment.js/printComment
function printComment(commentPath, options) {
  const comment = commentPath.getValue();

  if (isLineComment(comment)) {
    // Supports `//`, `#!`, `<!--`, and `-->`
    return options.originalText
      .slice(locStart(comment), locEnd(comment))
      .trimEnd();
  }

  if (isBlockComment(comment)) {
    if (isIndentableBlockComment(comment)) {
      const printed = printIndentableBlockComment(comment);
      // We need to prevent an edge case of a previous trailing comment
      // printed as a `lineSuffix` which causes the comments to be
      // interleaved. See https://github.com/prettier/prettier/issues/4412
      if (
        comment.trailing &&
        !hasNewline(options.originalText, locStart(comment), {
          backwards: true,
        })
      ) {
        return [hardline, printed];
      }
      return printed;
    }

    const commentEnd = locEnd(comment);
    const isInsideFlowComment =
      options.originalText.slice(commentEnd - 3, commentEnd) === "*-/";
    return [
      "/*",
      replaceTextEndOfLine(comment.value),
      isInsideFlowComment ? "*-/" : "*/",
    ];
  }

  /* istanbul ignore next */
  throw new Error("Not a comment: " + JSON.stringify(comment));
}