Skip to content

Commit

Permalink
Recommend to use es2019 & @tsconfig/react-native config
Browse files Browse the repository at this point in the history
  • Loading branch information
retyui committed Sep 24, 2022
1 parent c9448b0 commit f213a55
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,13 @@ yarn add -D typescript @types/jest @types/react @types/react-native @types/react

2. Add a TypeScript config file. Create a `tsconfig.json` in the root of your project:

```sh
yarn add --dev @tsconfig/react-native
```

```json
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": ["es2017"],
"types": ["react-native", "jest"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext"
},
"exclude": [
"node_modules",
"babel.config.js",
"metro.config.js",
"jest.config.js"
]
"extends": "@tsconfig/react-native/tsconfig.json"
}
```

Expand Down

0 comments on commit f213a55

Please sign in to comment.