Skip to content
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

Typescript support #2

Closed
wants to merge 1 commit into from
Closed

Conversation

MiguelMadero
Copy link

When I try to use it on typescript it says the transformation only works for JS. I tried this after changing the language mode to JS and it works jus fine.

This will likely work the same for flow, but I'm not familiar enough to test it.

When I try to use it on typescript it says the transformation only works for JS. I tried this after changing the language mode to JS and it works jus fine. 

This will likely work the same for flow, but I'm not familiar enough to test it.
@angryobject
Copy link
Owner

I'm not familiar with TS myself, are you sure that there are no cases where it will fail due to some TS magic, e.g. type declarations, different syntax etc.? Because jscodeshift works with JS, not TS.

I think if we do this we need to add some tests in TS to ensure everything is fine. I might look into this once I have time.

@angryobject
Copy link
Owner

Sorry, I can't merge this now, because recast and jscodeshift don't support TS yet. There issues opened in their repos, but until they are done, we can't do it. It probably works in some cases (like you had), but we can't rely on it.

benjamn/recast#424
benjamn/ast-types#213
facebook/jscodeshift#180

@MiguelMadero
Copy link
Author

👍 thanks for looking into it and sorry for not replying earlier.

@angryobject
Copy link
Owner

You can now set reactPureToClass.typescript setting to true to enable ts files support. But it comes with no guarantees =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants