src/language-js/print/type-parameters.js/printTypeParameter
function printTypeParameter(path, options, print) {
  const node = path.getValue();
  const parts = [];
  const parent = path.getParentNode();
  if (parent.type === "TSMappedType") {
    parts.push("[", print("name"));
    if (node.constraint) {
      parts.push(" in ", print("constraint"));
    }
    if (parent.nameType) {
      parts.push(
        " as ",
        path.callParent(() => print("nameType"))
      );
    }
    parts.push("]");
    return parts;
  }

  if (node.variance) {
    parts.push(print("variance"));
  }

  if (node.in) {
    parts.push("in ");
  }

  if (node.out) {
    parts.push("out ");
  }

  parts.push(print("name"));

  if (node.bound) {
    parts.push(": ", print("bound"));
  }

  if (node.constraint) {
    parts.push(" extends ", print("constraint"));
  }

  if (node.default) {
    parts.push(" = ", print("default"));
  }

  return parts;
}