CursorTypeScriptCode Style
TypeScript (React) Rules
const preferFunctionalComponents = true;
.cursorrules
// TypeScript React .cursorrules // Prefer functional components const preferFunctionalComponents = true; // TypeScript React best practices const typescriptReactBestPractices = [ "Use React.FC for functional components with props", "Utilize useState and useEffect hooks for state and side effects", "Implement proper TypeScript interfaces for props and state", "Use React.memo for performance optimization when needed", "Implement custom hooks for reusable logic", "Utilize TypeScript's strict mode", ]; // Folder structure const folderStructure = ` src/ components/ hooks/ pages/ types/ utils/ App.tsx index.tsx `; // Additional instructions const additionalInstructions = ` 1. Use .tsx extension for files with JSX 2. Implement strict TypeScript checks 3. Utilize React.lazy and Suspense for code-splitting 4. Use type inference where possible 5. Implement error boundaries for robust error handling 6. Follow React and TypeScript best practices and naming conventions 7. Use ESLint with TypeScript and React plugins for code quality
How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
#cursor#typescript#react#ai-coding-rules
Related Rules
Python Cursor Rules
CursorPython
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
Code Style
python · type-hintsCopy Ready
TypeScript Cursor Rules
CursorTypeScript
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
Code Style
typescript · strictCopy Ready
React Cursor Rules
CursorReact
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Architecture
react · hooksCopy Ready
Next.js Cursor Rules
CursorNext.js
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.
Architecture
nextjs · app-routerCopy Ready