Eliminates unsafe TypeScript assertions and fixes Drizzle ORM relation type inference issues.
The Type Safety skill is a specialized tool designed to harden TypeScript codebases, with a specific focus on resolving Drizzle ORM's known limitations with relation type inference. It identifies common 'Property does not exist' errors caused by relational queries and implements robust fix strategies including explicit joins, type-safe casting, and custom type guards. By automating the resolution of 'as unknown as' casts and manual type duplications, it ensures that your application's types remain synchronized with your database schema, significantly reducing runtime errors and improving developer productivity.
Key Features
01Automates the conversion of unsafe type assertions into explicit joins
02Resolves Drizzle ORM 'with' clause type inference failures
03Standardizes relational type aliases across the codebase
040 GitHub stars
05Identifies missing properties caused by recent database schema updates
06Implements type guards for safe handling of optional array access
Use Cases
01Refactoring legacy code to remove manual type overrides and 'any' casts
02Ensuring full type coverage when constructing complex objects manually from schema definitions
03Fixing TS2339 errors when accessing Drizzle relations like workout or competition