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.