File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,9 +3,7 @@ import { isComment } from '../slang-utils/is-comment.js';
33import type { AstPath , Doc } from 'prettier' ;
44import type { AstNode } from '../slang-nodes/types.d.ts' ;
55
6- export function printComment ( commentPath : AstPath < AstNode > ) : Doc {
7- const { node : comment } = commentPath ;
8-
6+ export function printComment ( { node : comment } : AstPath < AstNode > ) : Doc {
97 if ( isComment ( comment ) ) {
108 return comment . print ( ) ;
119 }
Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ function ignoreComments(path: AstPath<AstNode>): void {
3535 break ;
3636 // The key `comments` will contain every comment for this node
3737 case 'comments' :
38- path . each ( ( commentPath ) => {
39- const { node : comment } = commentPath ;
40- comment . printed = true ;
41- } , 'comments' ) ;
38+ path . each ( ( commentPath ) => ( commentPath . node . printed = true ) , key ) ;
4239 break ;
4340 default :
4441 // If the value for that key is an Array or an Object we go deeper.
You can’t perform that action at this time.
0 commit comments