From harness-claude
Provides tsconfig.json patterns for extends, project references, composite builds, and incremental compilation. Use for monorepo setups, new TypeScript projects, or troubleshooting compilation issues.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Configure tsconfig with extends, project references, composite builds, and incremental compilation
Optimizes TypeScript compilation time and reduces type complexity using incremental builds, skipLibCheck, project references, simplified generics, and tsconfig tweaks. For slow builds, IDE lag, or deep type errors.
Provides 2025 TypeScript strict mode tsconfig.json recommendations, explains strict flags like noUncheckedIndexedAccess, moduleResolution (Bundler vs NodeNext), verbatimModuleSyntax. Use for new projects or stricter type safety migrations.
Provides TypeScript and JavaScript expertise in type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.
Share bugs, ideas, or general feedback.
Configure tsconfig with extends, project references, composite builds, and incremental compilation
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"incremental": true,
"paths": { "@/*": ["./src/*"] }
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
// tsconfig.base.json
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true
}
}
// packages/api/tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src"]
}
// tsconfig.json (root)
{
"references": [
{ "path": "packages/shared" },
{ "path": "packages/api" },
{ "path": "packages/web" }
],
"files": []
}
// packages/shared/tsconfig.json
{
"compilerOptions": {
"composite": true,
"declaration": true,
"outDir": "./dist"
},
"include": ["src"]
}
// packages/api/tsconfig.json
{
"references": [{ "path": "../shared" }],
"compilerOptions": {
"composite": true,
"outDir": "./dist"
}
}
Build with: tsc --build (builds referenced projects in dependency order).
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo"
}
}
// tsconfig.json — IDE and type checking (no emit)
{
"compilerOptions": { "noEmit": true },
"include": ["src", "tests"]
}
// tsconfig.build.json — production build (emit, no tests)
{
"extends": "./tsconfig.json",
"compilerOptions": { "noEmit": false, "outDir": "dist" },
"include": ["src"],
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
}
Key options explained:
target — JavaScript version to emit. Use ES2022 for Node 18+, ES2021 for broader compatmodule — Module system. ESNext for bundler-based projects, NodeNext for Node.js packagesmoduleResolution — bundler for Vite/webpack/Next.js, NodeNext for Node.js librariesisolatedModules — required for esbuild/swc transpilation (one file at a time)skipLibCheck — skip type checking .d.ts files from dependencies. Almost always enableConfigure for testing:
// vitest needs jsdom types
{
"compilerOptions": {
"types": ["vitest/globals"]
}
}
tsconfig.json controls both the TypeScript compiler and the language service (IDE features). Many projects use TypeScript only for type checking (noEmit: true) while a bundler (Vite, esbuild, Next.js) handles actual compilation.
composite: true requirements:
declaration: true must be setinclude or listed in filesrootDir defaults to the directory containing tsconfig.jsontsc --build mode for dependency-aware compilationmoduleResolution choices:
bundler — best for projects using Vite, webpack, esbuild, Next.js. Allows extensionless imports, index.ts resolution, and package.json exportsNodeNext / Node16 — for pure Node.js packages. Requires .js extensions in imports (even for .ts files). Enforces ESM/CJS boundariesnode (legacy) — Node.js CommonJS resolution. Avoid for new projectspaths vs baseUrl: paths requires baseUrl in older TypeScript versions but since TypeScript 5.0+, paths can be relative to the tsconfig directory without baseUrl.
Trade-offs:
skipLibCheck: true speeds up compilation significantly — but hides type errors in .d.ts files from dependenciesincremental: true speeds up subsequent builds — but creates a .tsbuildinfo file that should be gitignoredisolatedModules is required for fast transpilers — but prevents const enum and namespace merging across fileshttps://typescriptlang.org/tsconfig