npm.io
8.1.1 • Published 2 months ago

@tsconfig/vite-react

Licence
MIT
Version
8.1.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
7.9K

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://www.schemastore.org/tsconfig",
  "_version": "8.1.1",

  "compilerOptions": {
    "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
    "target": "es2023",
    "lib": ["ES2023", "DOM"],
    "module": "esnext",
    "types": ["vite/client"],
    "allowArbitraryExtensions": true,
    "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.

Keywords