@@ -15,7 +15,7 @@ use biome_js_syntax::{
1515 JsBlockStatement , JsCallArguments , JsCatchClause , JsEmptyStatement , JsFinallyClause ,
1616 JsFormalParameter , JsFunctionBody , JsIdentifierBinding , JsIdentifierExpression , JsIfStatement ,
1717 JsLanguage , JsNamedImportSpecifiers , JsParameters , JsSyntaxKind , JsSyntaxNode ,
18- JsVariableDeclarator , JsWhileStatement , TsInterfaceDeclaration , TsMappedType ,
18+ JsVariableDeclarator , JsWhileStatement , TsFunctionType , TsInterfaceDeclaration , TsMappedType ,
1919} ;
2020use biome_rowan:: { AstNode , SyntaxNodeOptionExt , SyntaxTriviaPieceComments , TextLen } ;
2121use biome_suppression:: { SuppressionKind , parse_suppression_comment} ;
@@ -180,6 +180,12 @@ fn handle_typecast_comment(comment: DecoratedComment<JsLanguage>) -> CommentPlac
180180fn handle_after_arrow_fat_arrow_comment (
181181 comment : DecoratedComment < JsLanguage > ,
182182) -> CommentPlacement < JsLanguage > {
183+ if TsFunctionType :: can_cast ( comment. enclosing_node ( ) . kind ( ) ) {
184+ if let Some ( following_node) = comment. following_node ( ) {
185+ return CommentPlacement :: leading ( following_node. clone ( ) , comment) ;
186+ }
187+ return CommentPlacement :: Default ( comment) ;
188+ }
183189 if JsArrowFunctionExpression :: can_cast ( comment. enclosing_node ( ) . kind ( ) ) {
184190 // input
185191 // ```javascript
0 commit comments