Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Tools to facilitate data.world's migration from Flow to TypeScript

License

NotificationsYou must be signed in to change notification settings

datadotworld/ts-migration

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

These are a collection of tools that we used at Quizlet when migrating from Flow to TypeScript. We hope that you find these tools useful when doing your own migration, but keep in mind that they are made for the particularities of Quizlet's large codebase. You may need to modify these tools to suit your needs, but that said, they should be at the very least a good starting point.

The converter uses a fork ofbabel-plugin-flow-to-typescript along withRecast to preserve formatting. As it runs, it will rename files to.ts (or.tsx if it contains React), along with any snaps. In order to preserve the git history, this runs the conversion and commits the changes, and then renames all the files in a separate commit.

Installation

or add this indevDependencies:

"ts-migration": "git+https://github.com/datadotworld/ts-migration"

and runnpm install.

This tool assumes:

  1. TypeScript is installed in your codebase, and you have atsconfig.json configured to suit your needs.
  2. You use prettier, and you have a.prettierrc.

Commands:

Once installed, you can access the tools via the binary.

Preview a conversion (without renaming files):

npx ts-migration convert-codebase

Convert the codebase and rename files to.ts[x]:

npx ts-migration convert-codebase --commit

Ignore all TypeScript errors:

npx ts-migration ignore-errors [--commit] [--includeJSX]

The--includeJSX option can be extremely useful when you have a lot of errors you want to ignore, but will insert ignore comments in such a way that they can appear in the rendered HTML, so be sure to carefully review the output!

Strip Flow comments

npx ts-migration strip-comments [--commit]

License

ts-migration isMIT licensed.

About

Tools to facilitate data.world's migration from Flow to TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript99.9%
  • JavaScript0.1%

[8]ページ先頭

©2009-2025 Movatter.jp