From db2149759249e4f7fe793fea571186396fbdc2a8 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 25 Aug 2022 19:17:38 +0800 Subject: [PATCH] Docs: Fix handleComments function signature (#13308) --- docs/plugins.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index a6b26b2a9..d60c5bf08 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -410,18 +410,18 @@ Returns whether or not the AST node is a block comment. The `handleComments` object contains three optional functions, each with signature ```ts -function( - // The AST node corresponding to the comment - comment: AST, - // The full source code text - text: string, - // The global options object - options: object, - // The AST - ast: AST, - // Whether this comment is the last comment - isLastComment: boolean -): boolean +( + // The AST node corresponding to the comment + comment: AST, + // The full source code text + text: string, + // The global options object + options: object, + // The AST + ast: AST, + // Whether this comment is the last comment + isLastComment: boolean +) => boolean; ``` These functions are used to override Prettier's default comment attachment algorithm. `ownLine`/`endOfLine`/`remaining` is expected to either manually attach a comment to a node and return `true`, or return `false` and let Prettier attach the comment.