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

folder vs file #3

Open
jinman opened this issue Jul 24, 2023 · 1 comment
Open

folder vs file #3

jinman opened this issue Jul 24, 2023 · 1 comment

Comments

@jinman
Copy link

jinman commented Jul 24, 2023

Hi @alexanderjdean

Great tool, wondering whether we can use this tool to convert the entire project with multiple folders each containing javascript files to typescript? Will it retain the context across files?

Jin

@alexjdean
Copy link
Owner

Hi Jinesh,

There currently isn't a feature to convert whole folders in a repository to TypeScript (but it can! Contributions are welcome). One approach could be to convert file by file, but since the tool is using GPT 3.5, the conversion isn't perfect. There are ways you can mitigate this:

  • If your JS files have unit tests already, ensure that the TS versions pass those unit tests
  • If you don't have unit tests, you can use the tool to generate unit tests and ensure they're consistent across your project

I would suggest glancing over the JS version and TS versions side by side and ensuring no variable names have been changed or anything else that other files use as dependencies. Most of the time, the conversion goes perfectly and there isn't anything to worry about. While I think it's quite unlikely, since this is tool is using an LLM, there is always that risk factor.

Hope this helps and let me know if you have any more questions!
Alex

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

2 participants