@nrbx/react-tsconfig
v19.0.0
Published
Shared TypeScript configuration for @nrbx/react roblox-ts projects. Extend @nrbx/react-tsconfig in your tsconfig.json to get the correct JSX, types, and compiler settings for React.
Maintainers
Readme
@nrbx/react-tsconfig
Shared TypeScript configuration presets for roblox-ts projects using @nrbx/react.
Installation
npm install @nrbx/react-tsconfig --save-devThen in your tsconfig.json:
{
"extends": "@nrbx/react-tsconfig"
}Presets
| Preset | Extends | Description |
|---|---|---|
| @nrbx/react-tsconfig | tsconfig.json | Default preset. React JSX (react-jsx), strict mode, path aliases, Roblox types. |
| @nrbx/react-tsconfig/tsconfig.base.json | — | Bare minimum. ESNext target, commonjs module, noLib, synthetic imports. No JSX. Use for packages or non-UI code. |
| @nrbx/react-tsconfig/tsconfig.client.json | tsconfig.json | React JSX, scoped to src/client. Use when your workspace has separate client/server tsconfigs. |
| @nrbx/react-tsconfig/tsconfig.server.json | tsconfig.base.json | No JSX, scoped to src/server. Use for server-only code with no React dependency. |
| @nrbx/react-tsconfig/tsconfig.strict.json | tsconfig.json | Default settings plus extra strictness: noUnusedLocals, noUnusedParameters, exactOptionalPropertyTypes, noUncheckedIndexedAccess, noFallthroughCasesInSwitch, noImplicitReturns. |
What's Included
tsconfig.json (default)
jsx: "react-jsx"withjsxImportSource: "@nrbx/react"strict: true- Path aliases:
@client/*,@server/*,@shared/*mapping tosrc/client,src/server,src/shared typeRootsincluding both@rbxtsand@nrbxscopes
tsconfig.base.json (bare minimum)
target: "ESNext",module: "commonjs",moduleResolution: "Node"noLib: true,allowSyntheticDefaultImports: truedownlevelIteration: true,resolveJsonModule: trueforceConsistentCasingInFileNames: true- No JSX settings — add them yourself if needed
Overriding Settings
You can override any setting from a preset:
{
"extends": "@nrbx/react-tsconfig/tsconfig.strict.json",
"compilerOptions": {
"outDir": "dist",
"noUnusedLocals": false
}
}Built with roblox-ts
