Framework - React
Configure TypeScript for a bundler-built React application.
Usage
Add fw-react after Nova's required essentials and strict layers and the browser runtime.
tsconfig.json
{
"extends": [
"@cbnventures/nova/presets/tsconfig/dx-essentials.json",
"@cbnventures/nova/presets/tsconfig/dx-strict.json",
"@cbnventures/nova/presets/tsconfig/runtime-browser.json",
"@cbnventures/nova/presets/tsconfig/fw-react.json"
],
"include": [
"./src/**/*"
]
}
Compiler Options
| Option | Value | Purpose |
|---|---|---|
isolatedModules | true | Keeps every file safe for independent bundler transforms. |
jsx | "react-jsx" | Uses React's modern automatic JSX runtime. |
lib | ["DOM", "DOM.Iterable", "ESNext"] | Provides browser and modern JavaScript APIs. |
module | "ESNext" | Preserves ECMAScript modules for the bundler. |
moduleResolution | "Bundler" | Resolves package exports the way a modern bundler does. |
noEmit | true | Keeps TypeScript as the checker while the bundler owns output. |
Related
- Pair it with the matching Framework - React ESLint preset.
- Select it automatically with the Vite scaffold and
--framework react.