standards-typescriptlisted
Install: claude install-skill axrmxv/claude-config
# TypeScript Standards
The TypeScript delta over the always-loaded rules in `.claude/rules/common/`. The `camelCase` /
`PascalCase` / `UPPER_SNAKE_CASE` conventions and the immutability *principle* already live in
`common/` — this layer adds the TypeScript mechanisms and compiler settings only.
## What applies immediately
- **`strict: true`** in `tsconfig.json`. Non-negotiable.
- **No `any`.** Prefer `unknown` and narrow. Do not silence the checker with `as` assertions or
`// @ts-ignore` — fix the type.
- **A type is not a runtime guarantee.** Validate and narrow external input (request bodies, query
params, env vars, third-party responses) with a runtime schema such as **zod**, and derive the
static type from the schema so the two cannot drift.
- **Never** `eval`, `new Function`, or string arguments to `setTimeout` / `setInterval`.
- **`readonly` on what you expose**; `as const` for literal and config objects.
## Reference files
| File | Covers |
|------|--------|
| [coding-style.md](coding-style.md) | Type safety, immutability mechanisms, types vs interfaces, tooling |
| [patterns.md](patterns.md) | Structural interfaces, DTO types, `Result` discriminated unions, zod at boundaries |
| [security.md](security.md) | Type-safe boundaries, dangerous APIs, prototype pollution, `npm audit` |
| [testing.md](testing.md) | Vitest/Jest, coverage command, compile-time type tests |
| [hooks.md](hooks.md) | PostToolUse Prettier/ESLint/tsc hooks, `console.log` warnings |