Rule TypeScript

No Type Assertions

Avoid type assertions (as); narrow types with guards instead

typescripttypessafety
CLAUDE.md

Avoid type assertions (as). They bypass the type checker and hide bugs. Use type guards, instanceof, discriminated unions, or satisfies to narrow types safely.

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

get crystl