File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ const parsers = {
5151 [ antlrParserId ] : antlrParser
5252} ;
5353
54- const solidityCanAttachComment = ( node : { type : string } ) : boolean =>
54+ const antlrCanAttachComment = ( node : { type : string } ) : boolean =>
5555 typeof node . type === 'string' &&
5656 node . type !== 'BlockComment' &&
5757 node . type !== 'LineComment' ;
@@ -63,7 +63,7 @@ const canAttachComment = (node: AstNode): boolean =>
6363
6464// https://prettier.io/docs/en/plugins.html#printers
6565const antlrPrinter = {
66- canAttachComment : solidityCanAttachComment ,
66+ canAttachComment : antlrCanAttachComment ,
6767 handleComments : {
6868 ownLine : comments . solidityHandleOwnLineComment ,
6969 endOfLine : comments . solidityHandleEndOfLineComment ,
Original file line number Diff line number Diff line change @@ -20,10 +20,9 @@ function hasNodeIgnoreComment(node: StrictAstNode): boolean {
2020}
2121
2222function ignoreComments ( path : AstPath < AstNode > ) : void {
23- // TODO: remove undefined once we stop supporting prettier 2
2423 const node = path . getNode ( ) ;
2524 // We ignore anything that is not an object
26- if ( node === null || node === undefined || typeof node !== 'object' ) return ;
25+ if ( node === null || typeof node !== 'object' ) return ;
2726
2827 const keys = Object . keys ( node ) as ( keyof StrictAstNode ) [ ] ;
2928 for ( const key of keys ) {
@@ -64,7 +63,7 @@ function genericPrint(
6463) : Doc {
6564 const node = path . getNode ( ) ;
6665
67- if ( typeof node === 'undefined' || node === null ) {
66+ if ( node === null ) {
6867 return '' ;
6968 }
7069
You can’t perform that action at this time.
0 commit comments