omnivore/cursor-rules/frontend-frameworks-cursorrules.md

37 lines
1 KiB
Markdown

# Frontend Frameworks and Libraries - Cursor Rules
## Next.js Frontend Patterns
- Use App Router for new features
- Implement proper SSR/SSG where beneficial
- Use SWR for data fetching and caching
- Follow component composition patterns
- Use Stitches for styling (already in use)
- Implement proper error boundaries
- Use TypeScript with proper prop types
- Follow accessibility best practices
## React Components
- Use functional components with hooks
- Implement proper prop validation
- Use consistent naming (PascalCase)
- Keep components focused and small
- Use proper state management
- Implement proper cleanup in useEffect
## User Experience Guidelines
- Implement proper loading states
- Use optimistic updates where appropriate
- Handle offline scenarios gracefully
- Implement proper error messages
- Use consistent UI patterns
- Implement proper keyboard navigation
## Performance Considerations
- Optimize bundle sizes for web
- Implement lazy loading where beneficial
- Use CDN for static assets
- Monitor performance metrics