1.3.2 • Published 2 years ago

convert-js-to-ts v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

JavaScript to TypeScript

Small tool for converting JS to TS using TypeScript Abstract Syntax Tree (AST)

Basic usage

$ npx convert-js-to-ts --projectDir=.  --entrypoint=src/index.js 

Documentation

Usage: npx convert-js-to-ts [options]

Convert JavaScript Project to TypeScript

Options:
  -V, --version                   output the version number
  -p, --projectDir <string>       path/to/project
  -e, --entrypoint <string>       path/to/entrypoint/in/project ex: src/index.ts
  --outputDir <string|undefined>  path/to/output/dir, by default use projectDir
  --reconvertTs                   reconvert exist ts files (default: false)
  --eslint                        run eslint for converted files (default: false)
  -h, --help                      display help for command

Features

  • rename .js to .ts (using git)
  • replace require() with import
  • replace module.exports with export {} or export default
  • run eslint for converted files

In Progress

  • fix bug related to remove comments
  • improve import & export conversion
  • convert to ts that is ready to compile

License

MIT

1.3.2

2 years ago

1.3.1

2 years ago

1.2.12-beta.0

2 years ago

1.2.11

2 years ago

1.2.10

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago