@tsconfig/react-native

A base TSConfig for working with React Native.

Usage no npm install needed!

<script type="module">
  import tsconfigReactNative from 'https://cdn.skypack.dev/@tsconfig/react-native';
</script>

README

A base TSConfig for working with React Native.

Add the package to your "devDependencies":

npm install --save-dev @tsconfig/react-native
yarn add --dev @tsconfig/react-native

Add to your tsconfig.json:

"extends": "@tsconfig/react-native/tsconfig.json"

The tsconfig.json:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "React Native",
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "lib": [
      "es2017"
    ],
    "allowJs": true,
    "jsx": "react-native",
    "noEmit": true,
    "isolatedModules": true,
    "strict": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": false
  },
  "exclude": [
    "node_modules",
    "babel.config.js",
    "metro.config.js",
    "jest.config.js"
  ]
}

You can find the code here.