@stackra/typescript-config
Shared TypeScript configuration presets for all Stackra packages.
pnpm add -D @stackra/typescript-config
Preset
Import
Use Case
base
@stackra/typescript-config/base
Foundation — all options, extended by other presets
bundler
@stackra/typescript-config/bundler
Config packages built with tsup (sets outDir/rootDir)
react-lib
@stackra/typescript-config/react-lib
React component libraries
nest-lib
@stackra/typescript-config/nest-lib
NestJS libraries (NodeNext resolution)
nest-app
@stackra/typescript-config/nest-app
NestJS applications
next
@stackra/typescript-config/next
Next.js applications
react-native-lib
@stackra/typescript-config/react-native-lib
React Native libraries
react-native-app
@stackra/typescript-config/react-native-app
React Native apps (extends expo)
Library package (container, http, redis, support)
Config package (eslint-config, prettier-config, tsup-config)
Every option in base.json explained:
Option
Value
Why
target
ES2022
Top-level await, private fields, Array.at() — all @stackra packages target Node 22+
Option
Value
Why
module
ESNext
ESM-first output, optimized for tsup/vite/esbuild
moduleResolution
bundler
Understands package.json exports, no file extensions needed
moduleDetection
force
Every file is a module — prevents global scope pollution
Option
Value
Why
lib
ES2022, DOM, DOM.Iterable
ES2022 APIs + DOM for React hooks and jsdom tests
types
["node"]
Node.js globals (process, Buffer, etc.) — without this: "Cannot find name 'process'"
Option
Value
Why
strict
true
All strict checks: strictNullChecks, noImplicitAny, etc.
noUncheckedIndexedAccess
true
Array/object access returns T | undefined
noUnusedLocals
true
Flag unused variables (prefix with _ to ignore)
noUnusedParameters
true
Flag unused params (prefix with _ to ignore)
noImplicitReturns
true
Catch missing return statements
noFallthroughCasesInSwitch
true
Catch fall-through in switch
Option
Value
Why
declaration
true
Generate .d.ts for consumers
declarationMap
true
.d.ts.map for IDE "Go to Definition" into source
sourceMap
true
.js.map for debugging
Option
Value
Why
esModuleInterop
true
Default imports from CJS modules
allowSyntheticDefaultImports
true
import x from 'cjs-module' works
isolatedModules
true
Each file compiled independently (required by tsup/esbuild)
resolveJsonModule
true
import pkg from './package.json' works
skipLibCheck
true
Skip type-checking node_modules — massive speed boost
forceConsistentCasingInFileNames
true
Catches path casing bugs on macOS/Windows
Option
Value
Why
experimentalDecorators
true
@Injectable, @Inject, NestJS decorators
emitDecoratorMetadata
true
Runtime reflection for DI container
Option
Value
Why
jsx
react-jsx
Automatic JSX transform (React 17+) — no import React needed
Option
Value
Why
ignoreDeprecations
6.0
Silences baseUrl/paths deprecation warning in TS 6+ (still needed for @ aliases)
MIT © Stackra L.L.C