A shareable TypeScript configuration with strict type checking and modern compiler options.
- ✅ Strict type checking configuration
- 🔒 All strict mode options enabled
- 🚀 Latest ESNext target and module system
- 📦 Node.js
nodenextmodule resolution support - 🏗️ Monorepo-specific configuration included
- 🔄 ESM interoperability out of the box
npm install --save-dev @camaro/tsconfigOr using other package managers:
# pnpm
pnpm add -D @camaro/tsconfig
# yarn
yarn add -D @camaro/tsconfigCreate a tsconfig.json file in your project root and extend the base configuration:
{
"extends": "@camaro/tsconfig/base.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src"]
}If you're using a monorepo (such as pnpm workspaces, yarn workspaces, or lerna), use the dedicated monorepo configuration:
{
"extends": "@camaro/tsconfig/monorepo.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src"]
}The base configuration includes the following strict compiler options:
strict: true- Enable all strict type checking optionsnoImplicitReturns: true- Ensure all code paths in functions return a valuenoFallthroughCasesInSwitch: true- Prevent fallthrough errors in switch statementsnoUnusedLocals: true- Report unused local variablesnoUnusedParameters: true- Report unused parametersnoUncheckedIndexedAccess: true- Add undefined checks for index accessnoImplicitOverride: true- Ensure overriding members use the override modifierallowUnreachableCode: false- Disallow unreachable codeallowUnusedLabels: false- Disallow unused labels
module: "nodenext"- Use Node.js ESM and CommonJS supportmoduleResolution: "nodenext"- Node.js module resolution strategy
inlineSourceMap: true- Generate inline source maps
esModuleInterop: true- Enable ES module interoperabilityforceConsistentCasingInFileNames: true- Enforce consistent file name casing
target: "ESNext"- Compile to the latest ECMAScript standardlib: ["ESNext"]- Use the latest standard library type definitions
skipLibCheck: true- Skip type checking of declaration files for better performance
Extends base.json with additional options:
composite: true- Enable project references and incremental compilation, suitable for monorepo scenarios
- Strictness: Enables all TypeScript strict checking options to catch potential issues during development
- Modern: Uses ESNext target to support the latest JavaScript features
- Node.js Friendly: Uses
nodenextmodule system for perfect Node.js ESM support - Optimized Developer Experience: Configured with reasonable error detection and code hints
- Monorepo Support: Provides dedicated monorepo configuration with project reference support
Dunn