Skip to content

Commit ddf2394

Browse files
authored
Update MIGRATING.md
1 parent a1698ad commit ddf2394

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

MIGRATING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This Cheatsheet collates advice and utilities from real case studies of teams mo
1111
- Level 1: Unstrict TypeScript
1212
- `"noImplicitAny": false`
1313
- "[Just rename all .js files to .ts](https://twitter.com/jamonholmgren/status/1089241726303199232)"
14+
- installing all missing typings with [types-installer](https://www.npmjs.com/package/types-installer)
1415
- consider using `allowJS`? (Source: [clayallsop][clayallsop], [pleo][pleo])
1516
- Level 2: Strict TypeScript
1617
- use Microsoft's [`dts-gen`](https://github.com/Microsoft/dts-gen) to generate `.d.ts` files for your untyped files. [This SO answer](https://stackoverflow.com/questions/12687779/how-do-you-produce-a-d-ts-typings-definition-file-from-an-existing-javascript) has more on the topic.
@@ -80,6 +81,13 @@ Problems to be aware of:
8081

8182
## From JS
8283

84+
the "Just Renaming" strategy
85+
86+
- OSX/Linux: `find src -name "*.js" -exec sh -c 'mv"$0" "${0%.js}.tsx"' {} \;`
87+
88+
89+
More resources
90+
8391
- [TypeScript's official Guide for migrating from JS](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html)
8492
- [Migrating a `create-react-app`/`react-scripts` app to TypeScript](https://facebook.github.io/create-react-app/docs/adding-typescript) - don't use `react-scripts-ts`
8593
- [Migrating an EJECTED CRA app to TS](https://spin.atomicobject.com/2018/07/04/migrating-cra-typescript/)

0 commit comments

Comments
 (0)