A base TSConfig for working with Create React App.
Add the package to your "devDependencies"
:
npm install --save-dev @tsconfig/create-react-app
yarn add --dev @tsconfig/create-react-app
Add to your tsconfig.json
:
"extends": "@tsconfig/create-react-app/tsconfig.json"
The tsconfig.json
:
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Create React App",
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"target": "es5",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
}
}
You can find the code here.