ast-types icon indicating copy to clipboard operation
ast-types copied to clipboard

Add importKind to ImportSpecifier (import {type MyType} from './types')

Open IanVS opened this issue 3 years ago • 1 comments

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!

IanVS avatar Mar 15 '22 14:03 IanVS

Related: https://github.com/benjamn/ast-types/pull/745

IanVS avatar May 21 '22 03:05 IanVS