-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow adding a TS 4.5 style type import #103
Comments
Actually, I wonder if this is even possible. I opened a request at facebook/jscodeshift#481, because I think jscodeshift does not allow this kind of creation. |
Yeah, in fact i think this is actually a recast thing! Please LMK if you manage to find a solution :) |
I was able to find a way to accomplish what I was trying to do, and published an npm package: https://www.npmjs.com/package/type-import-codemod It didn't quite seem to fit with the goals of this project (it's not something intended to use with a particular library/package), but I did start off down that road at first and the scaffolding from the cli was helpful, so thanks! |
That's actually really cool lib, thanks for sharing! I can actually see this being incorporated into this library in a few ways!
Just for context, the goal of this project is to do the following:
Would love to pair with you to add this if you're interested in contributing 👍 |
I haven't forgotten about this issue, I've just been preoccupied with other things lately. But, I'm giving a talk at a meetup about codemods using my project above as an example, and will mention CodeshiftCommunity as well. I hope to come back to this once things have settled down a bit. |
That sounds fantastic! All the best with your talk!! Send me a link to the recording, would love to watch! |
Hey @IanVS, how'd your talk go!? Is there a recording or something I can watch! |
I'm trying to write a codemod that changes from the old style of type imports:
import type {MyType} from './types';
to the newer style:
import {type MyType} from './types';
I saw you have some import helpers, but don't see anything that allows creation of an ImportSpecifier with
importKind: "type"
, which I think is what is needed. Maybe you could consider adding it?Thanks!
The text was updated successfully, but these errors were encountered: