TypeScript compiler configuration — tsconfig.json structure, strict-mode flags and what each one catches, module resolution strategies (node/bundler/nodenext), and diagnosing/fixing slow type-checking. Use when bootstrapping a tsconfig.json for a new project, deciding which strictness flags to enable beyond `strict: true`, debugging a module-resolution error, or a `tsc --noEmit` run that has gotten too slow.
68
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
The tsconfig.json options that decide what the compiler catches and how fast it catches it.
Keep strict: true as the non-negotiable baseline and treat every additional strictness flag (noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns) as a default-on decision, not an opt-in one — the cost of a flag is some extra narrowing at the call sites it affects, and the cost of not having it is a defect the compiler could have caught but didn't. Never disable a strict-mode finding with @ts-ignore or strict: false; the defect it surfaced is still there, you've only removed the compiler's ability to tell you about it. When type-checking is slow, profile before guessing — tsc --extendedDiagnostics and project references usually explain the slowdown faster than trimming include patterns at random.
Use this skill when:
tsconfig.json for a new projectstrict bundleCannot find module, wrong resolution strategy for ESM/bundler setups)tsc --noEmit runsstrict: true?"tsconfig.json structure and common option choices.node, bundler, node16/nodenext) and their trade-offs.typescript-type-system skill.typescript-type-guards and typescript-practices skills.Do not use this skill for end-to-end test framework setup, CI pipeline configuration, or bundler configuration that isn't a tsconfig.json compiler option. Do not use it as a substitute for running tsc --noEmit — this skill explains what a setting does, but the compiler is the source of truth on whether the project actually type-checks under it.
npx tsc --noEmitnpx tsc --noEmit --extendedDiagnosticsnpx tsc --initWHY: the defect strict mode caught is still present in the code; @ts-ignore and strict: false only remove the compiler's ability to report it.
BAD:
{ "compilerOptions": { "strict": false } }GOOD:
{ "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true } }strict: true and stop there when the project can afford moreWHY: strict is a floor, not a ceiling — flags like noUncheckedIndexedAccess and exactOptionalPropertyTypes catch real classes of bugs strict alone leaves open.
BAD:
{ "compilerOptions": { "strict": true } }GOOD:
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}
}WHY: trimming include patterns or splitting files at random can miss the actual cause (often deep conditional-type recursion or an oversized project graph) while adding maintenance overhead for no measured gain.
BAD: Randomly excluding directories from include because "it feels slow."
GOOD: Run tsc --noEmit --extendedDiagnostics first, then act on what it reports (files checked, instantiation count, memory).
| File | Covers |
|---|---|
references/tsconfig.md | tsconfig.json structure and options |
references/strict-mode.md | Strict-mode flags and what each one catches |
references/module-resolution.md | Module resolution strategies |
references/performance.md | Diagnosing and improving type-checking speed |
a1083f4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.