diff --git a/src/index.d.ts b/src/index.d.ts index 0dc0c35ac..59497b507 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -497,6 +497,16 @@ export interface Printer { printComment?: | ((commentPath: AstPath, options: ParserOptions) => Doc) | undefined; + /** + * By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively. + * This function can be provided to override that behavior. + * @param node The node whose children should be returned. + * @param options Current options. + * @returns `[]` if the node has no children or `undefined` to fall back on the default behavior. + */ + getCommentChildNodes?: + | ((node: T, options: ParserOptions) => T[] | undefined) + | undefined; handleComments?: | { ownLine?: