File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function hasNodeIgnoreComment({ comments }: StrictAstNode): boolean {
2222 ) ;
2323}
2424
25- function ignoreComments ( path : AstPath < AstNode > ) : void {
25+ function ignoreComments ( path : AstPath < StrictAstNode > ) : void {
2626 const node = path . node ;
2727 // We ignore anything that is not an object
2828 if ( node === null || typeof node !== 'object' ) return ;
@@ -38,15 +38,17 @@ function ignoreComments(path: AstPath<AstNode>): void {
3838 break ;
3939 // The key `comments` will contain every comment for this node.
4040 case 'comments' :
41- path . each ( ( commentPath ) => ( commentPath . node . printed = true ) , key ) ;
41+ if ( node . comments !== undefined ) {
42+ path . each ( ( commentPath ) => ( commentPath . node . printed = true ) , key ) ;
43+ }
4244 break ;
4345 default :
4446 // If the value for that key is an Array or an Object we go deeper.
4547 const childNode = node [ key ] ;
4648 if ( typeof childNode === 'object' ) {
4749 if ( Array . isArray ( childNode ) ) {
4850 path . each ( ignoreComments , key ) ;
49- return ;
51+ break ;
5052 }
5153 path . call ( ignoreComments , key ) ;
5254 }
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "allowJs" : true ,
4+ "rootDir" : " ./src" ,
45 "outDir" : " ./dist/" ,
56 "noImplicitAny" : true ,
67 "strictPropertyInitialization" : true ,
78 "sourceMap" : true ,
8- "target" : " es6 " ,
9+ "target" : " es2023 " ,
910 "module" : " NodeNext" ,
1011 "moduleResolution" : " NodeNext" ,
1112 "strict" : true ,
You can’t perform that action at this time.
0 commit comments