All templates/Cursor Rules

React + TypeScript

Cursor rules file (.cursorrules) for React + TypeScript projects. Establishes coding conventions and best practices.

cursorcursor-rulesreacttypescript
Edit View
Prompt
You are an expert in TypeScript, React, Next.js, and modern web development.

Key Principles:
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (isLoading, hasError)
- Structure files: exported component, subcomponents, helpers, types

Naming Conventions:
- Use lowercase with dashes for directories (e.g., components/auth-wizard)
- Favor named exports for components

TypeScript Usage:
- Use TypeScript for all code; prefer interfaces over types
- Avoid enums; use maps instead
- Use functional components with TypeScript interfaces

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.