@tsconfig/vite-react
Version:
A base TSConfig for working with Vite React.
52 lines (39 loc) • 1.09 kB
Markdown
### A base TSConfig for working with Vite React.
Add the package to your `"devDependencies"`:
```sh
npm install --save-dev /vite-react
yarn add --dev /vite-react
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/vite-react/tsconfig.json"
```
---
The `tsconfig.json`:
```jsonc
{
"$schema": "https://www.schemastore.org/tsconfig",
"_version": "8.0.6",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023", "DOM"],
"module": "esnext",
"types": ["vite/client"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
}
}
```
You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/vite-react.json).