import { CallExpression , TypeChecker } from '@tsd/typescript' ; import { Diagnostic } from '../../interfaces' ; import { makeDiagnostic } from '../../utils' ; param checker param nodes return export const prinTypeWarning = ( checker , nodes ) : Diagnostic [ ] => { const diagnostics = [ ] ; if ( ! nodes ) { return diagnostics ; } for ( const node of nodes ) { const argumentType = checker . getTypeAtLocation ( node . arguments [ 0 ] ) ; const argumentExpression = node . arguments [ 0 ] . getText ( ) ; diagnostics . push ( makeDiagnostic ( node , `Type for expression \`${ argumentExpression }\` is: \`${ checker . typeToString ( argumentType ) }\`` , 'warning' ) ) ; } return diagnostics ; } ;