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

support working with .ts files #137

Closed
MagicDuck opened this issue Jun 19, 2018 · 4 comments
Closed

support working with .ts files #137

MagicDuck opened this issue Jun 19, 2018 · 4 comments

Comments

@MagicDuck
Copy link

So there's word on the web that babel7 now supports parsing typescript and recast has been modified to work with it. Apparently, jscodemod --parser babylon will now apply transforms on .ts files (facebook/jscodeshift#180 (comment)). It would be cool for babel-codemod to be able to handle .ts files as well. because it's my goto tool for running codemods now 😸. This is especially handy for cases where you have codebases in transition, with lots of old legacy in .js and newer legacy in .ts 😁
I am not sure how much work would be necessary to enable this or how feasible it is. As always though, I greatly appreciate your time.

eventualbuddha added a commit that referenced this issue Jun 20, 2018
To support TypeScript, mostly we just needed to use the `typescript` parser plugin when the file being processed is TypeScript.

BREAKING CHANGE: This expands the set of file extensions that babel-codemod will look for to include `.ts`, `.tsx`, `.es`, `.es6`, and `.mjs` in addition to `.js` and `.jsx`.

Closes #137
@eventualbuddha
Copy link
Collaborator

@MagicDuck thanks for the suggestion! Here you go: #139. Please try it out and let me know if you encounter any issues 😄

eventualbuddha added a commit that referenced this issue Jun 20, 2018
To support TypeScript, mostly we just needed to use the `typescript` parser plugin when the file being processed is TypeScript.

BREAKING CHANGE: This expands the set of file extensions that babel-codemod will look for to include `.ts`, `.tsx`, `.es`, `.es6`, and `.mjs` in addition to `.js` and `.jsx`.

Closes #137
eventualbuddha added a commit that referenced this issue Jun 20, 2018
To support TypeScript, mostly we just needed to use the `typescript` parser plugin when the file being processed is TypeScript.

BREAKING CHANGE: This expands the set of file extensions that babel-codemod will look for to include `.ts`, `.tsx`, `.es`, `.es6`, and `.mjs` in addition to `.js` and `.jsx`.

Closes #137
@babel-codemod-bot
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MagicDuck
Copy link
Author

Wow thanks @eventualbuddha! I will try it tomorrow!

@MagicDuck
Copy link
Author

@eventualbuddha works as expected. You is awesome! 🎆

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

No branches or pull requests

3 participants