Skip to content

Commit 1d0adec

Browse files
authored
document levels of adoption
1 parent 57ac328 commit 1d0adec

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

MIGRATING.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ This Cheatsheet collates advice and utilities from real case studies of teams mo
66
77
## General Conversion approaches
88

9+
- Level 0: Don't use TypeScript, use JSDoc
10+
- See our [JSDoc section](#JSDoc)
11+
- Level 1: Unstrict TypeScript
12+
- `"noImplicitAny": false`
13+
- "[Just rename all .js files to .ts](https://twitter.com/jamonholmgren/status/1089241726303199232)"
14+
- consider using `allowJS`? (Source: [clayallsop][clayallsop], [pleo][pleo])
15+
- Level 2: Strict TypeScript
16+
- 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.
17+
- use `declare` keyword for ambient declarations
18+
19+
20+
Misc tips/approaches successful companies have taken
21+
922
- `@ts-ignore` on compiler errors for libraries with no typedefs
1023
- pick ESLint over TSLint ([source](https://eslint.org/blog/2019/01/future-typescript-eslint))
1124
- New code must always be written in TypeScript. No exceptions. For existing code: If your task requires you to change JavaScript code, you need to rewrite it. (Source: [Hootsuite][hootsuite])
12-
- consider using `allowJS`? (Source: [clayallsop][clayallsop], [pleo][pleo])
13-
- consider `"noImplicitAny": false` if you need a gentler onboarding
14-
- 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.
15-
- use `declare` keyword for ambient declarations
25+
1626

1727
<details>
1828
<summary>

0 commit comments

Comments
 (0)