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