fakesamgregory

Cursor/Windsurf Global Settings

May 1st, 2025
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. ## 1. Project Structure
  2.  
  3. - Use consistent folder organization
  4. - Separate concerns (components, hooks, utilities, types)
  5. - Use Next.js recommended project guidelines
  6. - Keep files under 400 lines of code and break into smaller files/functions/components as often as possible
  7.  
  8. ## 2. TypeScript Rules
  9.  
  10. - Use strict mode
  11. - Always define explicit types
  12. - Avoid `any` type
  13. - Use interfaces and type aliases
  14. - Implement proper type narrowing
  15.  
  16. ## 3. Code Quality
  17.  
  18. - Follow ESLint and Prettier configurations
  19. - Keep functions small and focused (single responsibility)
  20. - Write clean, readable, and maintainable code
  21. - Use meaningful variable and function names
  22. - Add JSDoc comments for complex logic
  23.  
  24. ## 4. Performance Optimization
  25.  
  26. - Implement code splitting
  27. - Use React.memo for component memoization
  28. - Leverage useMemo and useCallback hooks
  29. - Minimize unnecessary re-renders
  30. - Use dynamic imports
  31. - Keep components as small as possible
  32.  
  33. ## 5. State Management
  34.  
  35. - Prefer React Context for global state
  36. - Use Zustand for complex state management
  37. - Avoid prop drilling
  38. - Keep state immutable
  39. - Centralize state logic
  40.  
  41. ## 6. Data Fetching
  42.  
  43. - Prioritize Supabase for backend operations
  44. - Use Tanstack Query for data fetching
  45. - Implement proper error handling
  46. - Add loading states
  47. - Cache server-side data
  48. - Use Express.js applicatication for REST functionality
  49.  
  50. ## 7. Security Practices
  51.  
  52. - Validate and sanitize all user inputs using Zod
  53. - Implement proper authentication checks using Supabase
  54. - Use Supabase RLS (Row Level Security)
  55. - Never expose sensitive information
  56. - Use environment variables
  57.  
  58. ## 8. Error Handling
  59.  
  60. - Create global error boundary
  61. - Log errors with context
  62. - Provide user-friendly error messages
  63. - Handle async operations carefully
  64. - Use try/catch blocks
  65.  
  66. ## 9. Styling
  67.  
  68. - Use Tailwind CSS utility classes
  69. - Create reusable component styles
  70. - Maintain consistent design system
  71. - Implement responsive design
  72. - Avoid inline styles
  73.  
  74. ## 10. Testing
  75.  
  76. - Write unit tests for critical components
  77. - Use Jest and React Testing Library
  78. - Aim for high test coverage
  79. - Test edge cases
  80. - Mock external dependencies
  81.  
  82. ## 11. Git Workflow
  83.  
  84. - Use feature branch workflow
  85. - Write descriptive commit messages
  86. - Use conventional commits
  87. - Implement PR review process
  88. - Squash commits before merging
  89.  
  90. ## 12. Performance Monitoring
  91.  
  92. - Use Google analytics
  93. - Implement performance logging
  94. - Monitor bundle size
  95. - Use Lighthouse for audits
  96. - Track critical web vitals
  97.  
  98. ## 13. Accessibility
  99.  
  100. - Follow WCAG guidelines
  101. - Use semantic HTML
  102. - Implement proper aria attributes
  103. - Support keyboard navigation
  104. - Test with screen readers
  105.  
  106. ## 14. Internationalization
  107.  
  108. - Use next-18next for translations
  109. - Support multiple language contexts
  110. - Design with text expansion in mind
  111. - Implement language switcher
  112.  
  113. ## 15. Environment Configuration
  114.  
  115. - Use .env.local for local secrets
  116. - Never commit sensitive information
  117. - Use different env files per environment
  118. - Validate environment variables
  119. - always create a .gitignore file with .env\* and node_modules already setup
  120.  
  121. ## 16. Instruction Rules
  122.  
  123. - Avoid having files over 400 lines of code. Refactor at that point.
  124. - Create helper functions for small tasks
  125. - Never add new libraries or dependencies without checking they exist first
  126. - Don't update code that is not directly related to the task
  127. - Never mock data for dev or prod
  128. - Always check codebase for similar code and functionality before writing new code
  129.  
Add Comment
Please, Sign In to add comment