Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattlewis92/js-to-typescript-codemod
A simple codemod for helping migrate from babel to typescript. Converts default imports to wildcards.
https://github.com/mattlewis92/js-to-typescript-codemod
Last synced: about 1 month ago
JSON representation
A simple codemod for helping migrate from babel to typescript. Converts default imports to wildcards.
- Host: GitHub
- URL: https://github.com/mattlewis92/js-to-typescript-codemod
- Owner: mattlewis92
- License: mit
- Created: 2016-11-21T14:59:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-20T10:52:57.000Z (about 5 years ago)
- Last Synced: 2024-11-02T20:32:31.425Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - js-to-typescript-codemod - A simple codemod for helping migrate from babel to typescript. Converts default imports to wildcards. (Typescript)
README
# js-to-typescript-codemod
A simple codemod for helping migrate from babel to typescript.There is a single transform that converts babel style ES6 imports to be typescript compatible e.g.
```
import moment from 'moment';
```to
```
import * as moment from 'moment';
```It will skip transforming modules not in node_modules or that already have a default export.
A best guess attempt is also made to convert webpack'd modules - the main files are statically analysed for a default export, and any non-js file imports are converted.
Usage
```
jscodeshift -t convert-default-imports.js
```