typescriptlisted
Install: claude install-skill kouroshez/coding-os
# TypeScript
TypeScript is only as safe as its strictness lets it be. With `strict` off (or `any`/`!` sprinkled in) it's JavaScript with extra syntax — the checker is on but blindfolded. The craft is letting the type system *prove* the bug can't happen, not narrating types after the fact.
> Check a tsconfig for the strict flags that actually matter:
> `python3 scripts/check_tsconfig.py tsconfig.json`
## Strict is the floor
```jsonc
// tsconfig.json — the flags that catch real bugs
{
"compilerOptions": {
"strict": true, // the umbrella — turn it on, always
"noUncheckedIndexedAccess": true, // arr[i] is T | undefined (it really is!)
"noImplicitOverride": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true
}
}
```
`strict: true` enables `noImplicitAny`, `strictNullChecks`, and more — without it, `null`/`undefined` are assignable everywhere and the #1 class of runtime crash goes uncaught. `noUncheckedIndexedAccess` is the highest-value non-default: it makes `arr[i]` honestly `T | undefined`. Full rationale → [references/strictness.md](references/strictness.md).
## `unknown`, never `any`
```typescript
// Wrong — any disables the checker for everything downstream; the bug ships
function parse(json: string): any { return JSON.parse(json); }
const u = parse(s); u.naem.toUpperCase(); // typo compiles, crashes at runtime
// Correct — unknown forces you to narrow before use
function parse(json: string):