Fix Types
Fix TypeScript errors automatically.
Usage
/fix-types
/fix-types src/auth.ts
Workflow
- Run typecheck - Find all type errors
- Analyze - Understand each error
- Fix - Apply type fixes
- Verify - Re-run typecheck
Common Errors
Missing Type
// Error
const value: any = getData();
// Fix
const value: DataType = getData();
Type Mismatch
// Error
const result: string = calculateNumber();
// Fix
const result: number = calculateNumber();
Missing Property
// Error
user.name.toUppercase();
// Fix
user.name?.toUppercase() || '';
Auto-Fix
npm run typecheck --fix
Note: Not all type errors can be auto-fixed.