1- // Vue 3 Composition API .cursorrules
1+ # Vue 3 Composition API Project Rules
22
3- // Vue 3 Composition API best practices
4- const vue3CompositionApiBestPractices = [
5- "Use setup() function for component logic",
6- "Utilize ref and reactive for reactive state",
7- "Implement computed properties with computed()",
8- "Use watch and watchEffect for side effects",
9- "Implement lifecycle hooks with onMounted, onUpdated, etc.",
10- "Utilize provide/inject for dependency injection",
11- "Use vue 3.5 style of default prop declaration. Example:
3+ ## Vue 3 Composition API Best Practices
4+ - Use setup() function for component logic
5+ - Utilize ref and reactive for reactive state
6+ - Implement computed properties with computed()
7+ - Use watch and watchEffect for side effects
8+ - Implement lifecycle hooks with onMounted, onUpdated, etc.
9+ - Utilize provide/inject for dependency injection
10+ - Use vue 3.5 style of default prop declaration. Example:
1211
12+ ```typescript
1313const { nodes, showTotal = true } = defineProps<{
1414 nodes: ApiNodeCost[]
1515 showTotal?: boolean
1616}>()
17+ ```
1718
18- ",
19- "Organize vue component in <template> <script> <style> order",
20- ]
19+ - Organize vue component in <template> <script> <style> order
2120
22- // Folder structure
23- const folderStructure = `
21+ ## Project Structure
22+ `` `
2423src/
2524 components/
2625 constants/
3029 services/
3130 App.vue
3231 main.ts
33- `;
32+ ```
3433
35- // Tailwind CSS best practices
36- const tailwindCssBestPractices = [
37- "Use Tailwind CSS for styling",
38- "Implement responsive design with Tailwind CSS",
39- ]
34+ ## Styling Guidelines
35+ - Use Tailwind CSS for styling
36+ - Implement responsive design with Tailwind CSS
4037
41- // PrimeVue deprecated components - DO NOT USE
42- const deprecatedPrimeVueComponents = [
43- "DO NOT use deprecated PrimeVue components. Use these replacements instead:",
44- "Dropdown → Use Select (import from 'primevue/select')",
45- "OverlayPanel → Use Popover (import from 'primevue/popover')",
46- "Calendar → Use DatePicker (import from 'primevue/datepicker')",
47- "InputSwitch → Use ToggleSwitch (import from 'primevue/toggleswitch')",
48- "Sidebar → Use Drawer (import from 'primevue/drawer')",
49- "Chips → Use AutoComplete with multiple enabled and typeahead disabled",
50- "TabMenu → Use Tabs without panels",
51- "Steps → Use Stepper without panels",
52- "InlineMessage → Use Message component"
53- ]
38+ ## PrimeVue Component Guidelines
39+ DO NOT use deprecated PrimeVue components. Use these replacements instead:
40+ - Dropdown → Use Select (import from 'primevue/select')
41+ - OverlayPanel → Use Popover (import from 'primevue/popover')
42+ - Calendar → Use DatePicker (import from 'primevue/datepicker')
43+ - InputSwitch → Use ToggleSwitch (import from 'primevue/toggleswitch')
44+ - Sidebar → Use Drawer (import from 'primevue/drawer')
45+ - Chips → Use AutoComplete with multiple enabled and typeahead disabled
46+ - TabMenu → Use Tabs without panels
47+ - Steps → Use Stepper without panels
48+ - InlineMessage → Use Message component
5449
55- // Additional instructions
56- const additionalInstructions = `
50+ ## Development Guidelines
57511. Leverage VueUse functions for performance-enhancing styles
58522. Use lodash for utility functions
59533. Use TypeScript for type safety
@@ -63,7 +57,5 @@ const additionalInstructions = `
63577. Implement proper error handling
64588. Follow Vue 3 style guide and naming conventions
65599. Use Vite for fast development and building
66- 10. Use vue-i18n in composition API for any string literals. Place new translation
67- entries in src/locales/en/main.json.
60+ 10. Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
686111. Never use deprecated PrimeVue components listed above
69- `;
0 commit comments