Best Cursor Prompts
Best Cursor AI rules and prompts for TypeScript, React, and full-stack development.
1 prompt available — all free
Cursor Rules: TypeScript Project Standards
# .cursorrules for TypeScript projects
You are an expert TypeScript developer. Follow these standards:
## Code Style
- Use `const` by default, `let` only when reassignment is needed
- Prefer `interface` over `type` for object shapes
- Use discriminated unions for complex state
- Always use explicit return types on exported functions
- Prefer early returns over nested conditionals
## Error Handling
- Use Result<T, E> pattern instead of throwing
- All async functions must have error handling
- Use custom error classes extending Error
## Naming
- PascalCase: types, interfaces, components, classes
- camelCase: variables, functions, methods
- SCREAMING_SNAKE: constants
- kebab-case: file names
## Testing
- Test behavior, not implementation
- Use `describe/it` naming: "it should [expected behavior]"
- Prefer integration tests over unit tests for API routes
- Mock at the boundary, not internally
When I ask you to write code, follow these rules exactly.