Shared TypeScript configurations
npm install @dvashim/typescript-config  
npm:
``bash`
npm install -D @dvashim/typescript-config
or pnpm:
`bash`
pnpm add -D @dvashim/typescript-config
| Name | Path |
|------|------|
| Base | @dvashim/typescript-config or @dvashim/typescript-config/base |@dvashim/typescript-config/lib
| Library development | or @dvashim/typescript-config/lib/dev |@dvashim/typescript-config/lib/prod
| Library production | |@dvashim/typescript-config/app/react
| React JSX application | |@dvashim/typescript-config/app/react/vite
| Vite + React JSX application | |@dvashim/typescript-config/node
| Node | |
Base configuration:
`jsonc
// tsconfig.json (base)
// Very strict + future-proof setup with full ESM support
// (es2022 + verbatimModuleSyntax), bundler-friendly resolution,
// no emitted .js files on error, strong type-safety guards,
// and clean imports — ideal for libraries, Vite/React apps,
// monorepos and high-quality TypeScript projects
// that want to catch as many mistakes as possible at compile time.
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.base.tsbuildinfo",
},
"include": ["src"]
}
`
Library development configuration:
`jsonc
// tsconfig.json (library development)
// Modern strict es2022 + ESM + bundler-mode configuration
// for libraries / monorepos / bundler-based projects
// with verbatimModuleSyntax, full strictness,
// clean .d.ts emit (best practices)
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config/lib/dev",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.dev.tsbuildinfo",
},
"include": ["src"]
}
`
Library production configuration:
`jsonc
// tsconfig.json (library production)
// Modern strict es2022 + ESM + bundler-mode configuration
// for libraries / monorepos / bundler-based projects
// with verbatimModuleSyntax, full strictness,
// clean .d.ts emit, no source maps / comments
// (best practices)
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config/lib/prod",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.prod.tsbuildinfo",
},
"include": ["src"]
}
`
React JSX application configuration:
`jsonc
// tsconfig.json (react jsx application)
// Strict, modern, no-emit configuration for
// React + ESM/bundler workflows
// (Vite/Turbopack/esbuild compatible)
// with verbatim module syntax and full type safety.
// Very strict settings, modern ESM resolution,
// React JSX transform, no emitted .js files,
// supports importing .ts/.tsx extensions directly.
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config/app/react",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
},
"include": ["src"]
}
`
Vite + React JSX application configuration:
`jsonc
// tsconfig.json (vite + react jsx application)
// Strict, modern, no-emit configuration for
// Vite + React projects with verbatim module syntax
// and full type safety.
// Very strict settings, modern ESM resolution,
// React JSX transform, no emitted .js files,
// supports importing .ts/.tsx extensions directly.
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config/app/react/vite",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
},
"include": ["src"]
}
`
Node configuration:
`jsonc
// tsconfig.json (node)
// Strict configuration for ESM + bundler environments
// (Vite, esbuild, Bun, Parcel, Turbopack, Rollup, etc.)
// Designed for tools that handle bundling, transpilation
// and module resolution themselves
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@dvashim/typescript-config/node",
"include": ["vite.config.ts"]
}
`
* Module
* module: es2022 — Specifies the module code generation format.force
* moduleDetection: — Forces all files to be treated as ES modules.bundler
* moduleResolution: — Module resolution strategy optimized for modern bundlers.true
* verbatimModuleSyntax: — Preserves import and export syntax exactly as written.true
* resolveJsonModule: — Allows importing .json files as typed modules.
* Strictness
* strict: true — Enables all strict type-checking options.true
* exactOptionalPropertyTypes: — Treats optional properties as strictly T | undefined.true
* noImplicitOverride: — Requires the override keyword when overriding class members.true
* noPropertyAccessFromIndexSignature: — Disallows property access via dot notation when defined only by an index signature.true
* noUncheckedIndexedAccess: — Adds undefined to types accessed via index signatures.
* Safety
* noUncheckedSideEffectImports: true — Reports errors for side-effect imports that are not explicitly used.true
* allowUnreachableCode: — Allows unreachable code without compiler errors.false
* allowUnusedLabels: — Disallows unused labels in the code.true
* forceConsistentCasingInFileNames: — Ensures consistent casing in file name imports across the project.true
* noFallthroughCasesInSwitch: — Reports errors for fallthrough cases in switch statements.true
* noImplicitReturns: — Reports errors when not all code paths in a function return a value.true
* noUnusedLocals: — Reports errors for unused local variables.true
* noUnusedParameters: — Reports errors for unused function parameters.false
* allowJs: — Disallows JavaScript files from being included in the compilation.
* Emit
* target: es2022 — Sets the JavaScript language version for emitted output.remove
* importsNotUsedAsValues: — Removes imports used only for types from emitted JavaScript.true
* noEmitOnError: — Prevents emitting output files when type errors are present.["ES2022"]
* lib: — Specifies built-in library declaration files included in compilation.true
* erasableSyntaxOnly: — Restricts usage to syntax that can be fully erased during compilation.true
* skipLibCheck: — Skips type checking of declaration files for faster builds.true
* useDefineForClassFields: — Emits class fields using ECMAScript-standard define semantics.
---
This configuration extends the base configuration and overrides some compiler options
* Module
* module: esnext — Specifies the module code generation format.
* Emit
* noEmit: true — Disables emitting compiled JavaScript files.
* Target / Language
* target: es2023 — Sets the JavaScript language version for emitted output.["ES2023"]
* lib: — Specifies built-in library declaration files included in compilation.
* Types
* types: ["node"] — Includes type declarations for Node.js.
* Module Features
* allowImportingTsExtensions: true — Allows importing TypeScript files with explicit .ts` extensions.