Rule TypeScript

Use Generics

Write reusable, type-safe functions with generics

typescriptgenericsreuse
CLAUDE.md

Use generics to write reusable, type-safe functions. Prefer function first<T>(items: T[]): T | undefined over function first(items: any[]): any. Generics preserve type information through transformations.

Copy this block into your CLAUDE.md or agent config file to enforce it in your workflow.

get crystl