Add importKind to ImportSpecifier (import {type MyType} from './types')#725
Add importKind to ImportSpecifier (import {type MyType} from './types')#725IanVS wants to merge 1 commit intobenjamn:masterfrom
Conversation
|
Related: #745 |
| .field("imported", def("Identifier")); | ||
| .build("imported", "local", "importKind") | ||
| .field("imported", def("Identifier")) | ||
| .field("importKind", or("type", null), defaults["null"]); |
There was a problem hiding this comment.
| .field("importKind", or("type", null), defaults["null"]); | |
| .field("importKind", or("value", "type"), () => "value"); |
This way it matches the convention found on ImportDeclaration below.
There was a problem hiding this comment.
Thanks! I'd make the change, but as far as I can tell this project is dead. @benjamn doesn't work at Facebook anymore, and I guess nobody else has stepped in to maintain it.
There was a problem hiding this comment.
Fair enough. In a future where someone does step up to merge PRs here again, this PR thread can serve as a record of a change that should be made.
I think it's too soon to call the project dead; dormant, yes. Ben merged and wrote a burst of changes as recently as last November.
There's a recent thread over on the related project Recast, where he titled the issue "Recast needs additional maintainers": benjamn/recast#1086 (comment) I expect that if there do arise additional maintainers for Recast, they'll also end up maintaining ast-types, given that they're closely related and ast-types is smaller.
I'm working on a codemod to transform type imports into the new Typescript 4.5 syntax: facebook/jscodeshift#481
I wanted to use
ImportSpecifierBuilderto 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 anyimport typestyle tests, so I'm not sure where it should go or what it would look like. Any guidance would be much appreciated!