ast-types
ast-types copied to clipboard
Add importKind to ImportSpecifier (import {type MyType} from './types')
I'm working on a codemod to transform type imports into the new Typescript 4.5 syntax: https://github.com/facebook/jscodeshift/issues/481
I wanted to use ImportSpecifierBuilder to construct an import specifier that is a type import, but that was impossible. I've never worked with ast-types before, so I'm not sure if I did this correctly. And I was looking for tests to expand, but I couldn't find any import type style tests, so I'm not sure where it should go or what it would look like. Any guidance would be much appreciated!
Related: https://github.com/benjamn/ast-types/pull/745