code-review-typescript
Installation
SKILL.md
TypeScript Code Review Patterns
Stack-specific rules loaded by dh:code-reviewer when tsconfig.json, *.ts, or *.tsx files are detected.
Strict Mode
tsconfig.jsonmust enablestrict: true— this coversnoImplicitAny,strictNullChecks,strictFunctionTypes, and othersexactOptionalPropertyTypes: trueis required in new projects — preventsundefinedfrom being assigned to optional propertiesnoUncheckedIndexedAccess: trueis required when indexing arrays or records — prevents silentundefinedpropagation- Any
@ts-ignorecomment without an accompanying explanation comment is a blocking finding @ts-expect-erroris preferred over@ts-ignore— it fails if the error goes away
Type Safety
anytype without an explanatory comment is a blocking finding- Type assertions (
as SomeType) without runtime validation at the same boundary are a blocking finding unknownis the correct type for values from external sources — validate before narrowing, not afterobjectas a type is not meaningful — useRecord<string, unknown>or a specific interface- Non-null assertions (
value!) without a comment explaining why null is impossible are a blocking finding