TypeScript Strict Rules Pack
$12
https://schema.org/InStock
usd
Ned C
The Problem
Cursor takes shortcuts with TypeScript — any types, non-null assertions, loose checks. You end up with code that compiles but breaks at runtime.
The Fix
Drop one .cursorrules file into your project root. Cursor immediately writes strict, production-safe TypeScript.
What's Inside
🔷 Strict Type Patterns
- unknown with type guards instead of any
- Discriminated unions for complex state
- Branded types for IDs and special strings
- Explicit return types on all functions
- Const assertions and readonly patterns
🛡️ Runtime Safety
- Zod schemas for external data validation
- Proper error handling with typed errors
- Exhaustive switch statements
- No non-null assertions (!)
⚙️ Compiler Flags
- strict: true baseline
- noUncheckedIndexedAccess
- exactOptionalProperties
- noImplicitOverride
- verbatimModuleSyntax
🚫 Anti-Patterns Blocked
- No any types
- No as type assertions (use type guards)
- No ! non-null assertions
- No implicit any in callbacks
- No @ts-ignore
Setup
- Download the .cursorrules file
- Drop it in your project root
- Done. Cursor picks it up automatically.
What You Get
- .cursorrules file (works immediately)
- README.md with full documentation
- SETUP.md with installation guide and tsconfig recommendations
0 sales
.cursorrules file (works immediately) README.md with full documentation SETUP.md with installation guide and tsconfig recommendations
Size
6.32 KB
Add to wishlist