0.0.0-alpha ā€¢ Published 8 months ago

ts-initialize v0.0.0-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Usage

ts-initialize is a CLI tool to onboard an existing project onto TypeScript in as few changes as possible. It will:

  1. Create a TSConfig with settings tailored to your project
  2. Rewrite any require()s as ESM imports
  3. Rename your JavaScript files to the appropriate TypeScript extension
  4. Rewrite extension-less imports to include an extension as needed
  5. Rewrite import paths for situations where the type system explicitly needs extensions
  6. Install @types/ packages that exist for dependencies

It will not:

  • Modify the runtime behavior of your code
  • Infer explicit type annotations (use ts-enhance for that)
  • Augment configurations for common existing tools such as Babel and typescript-eslint (yet!)

āš” To start, the ts-initialize command will launch an interactive guide to setting up a configuration file. āš”

npx ts-initialize
šŸ‘‹ Welcome to ts-initialize! šŸ‘‹
...

After running ts-initialize, use ts-enhance for improving the types in your code.

Development

See Development.md. šŸ’–

šŸ’™ This package is based on @JoshuaKGoldberg's create-typescript-app.