TypeScript Strictness Enforcer
When to Trigger
- •Creating new files
- •Modifying types
- •Using 'any'
What to Do
- •Remove any: Replace with proper types or unknown and narrow.
- •Null/undefined: Use optional chaining, nullish coalescing, or explicit return type (e.g. string | null).
- •tsconfig: Recommend strict, noUncheckedIndexedAccess, noImplicitAny, strictNullChecks, noUnusedLocals, noUnusedParameters where appropriate.
- •Interfaces: Define for function params and return types; use Prisma types or shared types from lib/types.
Suggest fixes with code; don’t weaken types to satisfy checks. Prefer type-safe patterns (discriminated unions, type guards).