import * as ts from 'typescript' ; export const isNodeDisabledViaComment = ( node , file ) : boolean => { const comments = ts . getLeadingCommentRanges ( file . getFullText ( ) , node . getFullStart ( ) ) ; if ( comments ) { const commentRange = comments [ comments . length - 1 ] ; const commentText = file . getFullText ( ) . substring ( commentRange . pos , commentRange . end ) ; if ( commentText === '// ts-unused-exports:disable-next-line' ) { return true ; } } return false ; } ;