← ClaudeAtlas

standards-typescriptlisted

TypeScript coding standards — strict mode, no any or as assertions, readonly and as const immutability, discriminated unions, zod validation at boundaries, Vitest/Jest with 80% coverage, Prettier and ESLint. Use when writing, reviewing, or testing TypeScript or TSX code.
axrmxv/claude-config · ★ 1 · Testing & QA · score 70
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 |