From f213a55b241e7630144add29b70b1dd39aaa12ad Mon Sep 17 00:00:00 2001 From: David <4661784+retyui@users.noreply.github.com> Date: Sat, 24 Sep 2022 11:41:12 +0200 Subject: [PATCH] Recommend to use `es2019` & `@tsconfig/react-native` config --- docs/typescript.md | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/docs/typescript.md b/docs/typescript.md index e3e52e66439..14330a1c7da 100644 --- a/docs/typescript.md +++ b/docs/typescript.md @@ -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" } ```