← ClaudeAtlas

typescriptlisted

Enforce TypeScript 5+ strict type-checking. Use when editing .ts/.tsx or tsconfig.json, or when the user mentions TypeScript, any, unknown, strict mode, type assertion, generics, enum, or @ts-ignore. Forbids any, as any, @ts-ignore, namespace, non-const enum; forces strict tsconfig and unknown over any.
zhaojiannet/canon · ★ 1 · Web & Frontend · score 77
Install: claude install-skill zhaojiannet/canon
This skill enforces TypeScript strict type-checking. The rule: trust the type system, no escape hatches. Apply only when the project uses `typescript ^5.0` or higher. If `package.json` pins an older major, **STOP** and ask the user. ## tsconfig requirements ```json { "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, "noUnusedParameters": true } } ``` `strict: true` enables `noImplicitAny` / `strictNullChecks` / `strictFunctionTypes` / `strictBindCallApply` / `strictPropertyInitialization` / `noImplicitThis` / `alwaysStrict` / `useUnknownInCatchVariables` / `strictBuiltinIteratorReturn`. Add `noUncheckedIndexedAccess` / `exactOptionalPropertyTypes` / `noImplicitOverride` / `noPropertyAccessFromIndexSignature` to harden further. ## Forbidden patterns - `any` type (explicit or via inference). Use `unknown` and narrow with type guards. - `as any` / `as unknown as Foo` chained casts. Either fix the upstream type or write a proper type guard. - `// @ts-ignore`. Use `// @ts-expect-error <reason>` so the suppression breaks if the underlying issue is fixed. - `namespace Foo { ... }`. Use ES module imports/exports. - `enum Color { ... }`. Use `const Color = { Red: 'red', Blue: 'blue' } as const; type Color = typeof Color[keyof typeof Color]`. - `function foo(