import { AstNode , BinaryExpression , Expression , FunctionDeclaration , IfStatement , Node , Printable , TemplateElement , UnaryExpression , VariableDeclaration , } from 'ast-types' ; import { Collection , JsCodeShift } from 'jscodeshift' ; import { CodeModExports } from '../codeModTypes' ; const codeMod = ( ( fileInfo , api , options ) => { const j = api . jscodeshift ; const ast = fileInfo . ast ; const target = options . target ; const node = target . firstNode < VariableDeclaration > ( ) ! ; node . kind = 'let' ; const resultText = ast . toSource ( ) ; return resultText ; } ) as CodeModExports ; codeMod . canRun = ( fileInfo , api , options ) => { const j = api . jscodeshift ; const ast = fileInfo . ast ; const target = options . target ; const node = target . firstNode ( ) ; return j . VariableDeclaration . check ( node ) && ( node . kind === 'var' || node . kind === 'const' ) ; } ; codeMod . scope = 'cursor' ; codeMod . title = 'Convert to let' ; codeMod . description = '' ; codeMod . detail = '' ; module . exports = codeMod ;