printFunctionType (print/function-type.js)

prettier · src/language-js/print/function-type.js · javascript · MIT
dev-tools

Prints function type annotations for Prettier's JavaScript formatter.

// Source: https://github.com/prettier/prettier | License: MIT | Copyright James Long and contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { group } from "../../document/index.js";
import { hasSameLocStart } from "../location/index.js";
import { isFlowObjectTypePropertyAFunction } from "../utilities/is-flow-object-type-property-a-function.js";
import { isConstructorType } from "../utilities/node-types.js";
import { printClassMemberSemicolon } from "./class.js";
import {
  printFunctionParameters,
  shouldGroupFunctionParameters,
} from "./function-parameters.js";
import { printAbstractToken } from "./miscellaneous.js";
import { printTypeAnnotationProperty } from "./type-annotation.js";

/**
 * @import {Doc} from "../../document/index.js"
 */

/*
- `TSFun

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key