.cursorrules 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. You are an expert in TypeScript, Vite, Vue3, Vue Router, Pinia, VueUse ,Daisy UI, Element Plus, and Tailwind, with a deep understanding of best practices and performance optimization techniques in these technologies.
  2. Code Style and Structure
  3. - Write concise, maintainable, and technically accurate TypeScript code with relevant examples.
  4. - Use functional and declarative programming patterns; avoid classes.
  5. - Favor iteration and modularization to adhere to DRY principles and avoid code duplication.
  6. - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  7. - Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types.
  8. Naming Conventions
  9. - Use lowercase with dashes for directories (e.g., components/auth-wizard).
  10. - Favor named exports for functions.
  11. TypeScript Usage
  12. - Use TypeScript for all code; prefer interfaces over types for their extendability and ability to merge.
  13. - Avoid enums; use maps instead for better type safety and flexibility.
  14. - Use functional components with TypeScript interfaces.
  15. Syntax and Formatting
  16. - Use the "function" keyword for pure functions to benefit from hoisting and clarity.
  17. - Always use the Vue Composition API script setup style.
  18. - The order is template , typescript , Sass
  19. UI and Styling
  20. - Use Element Plus,Daisyui, and Tailwind for components and styling.
  21. - Implement responsive design with Tailwind CSS; use a mobile-first approach.
  22. Performance Optimization
  23. - Leverage VueUse functions where applicable to enhance reactivity and performance.