mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 09:45:13 +00:00
[docs] Convert .cursorrules to standard markdown format (#4099)
This commit is contained in:
70
.cursorrules
70
.cursorrules
@@ -1,26 +1,25 @@
|
|||||||
// Vue 3 Composition API .cursorrules
|
# Vue 3 Composition API Project Rules
|
||||||
|
|
||||||
// Vue 3 Composition API best practices
|
## Vue 3 Composition API Best Practices
|
||||||
const vue3CompositionApiBestPractices = [
|
- Use setup() function for component logic
|
||||||
"Use setup() function for component logic",
|
- Utilize ref and reactive for reactive state
|
||||||
"Utilize ref and reactive for reactive state",
|
- Implement computed properties with computed()
|
||||||
"Implement computed properties with computed()",
|
- Use watch and watchEffect for side effects
|
||||||
"Use watch and watchEffect for side effects",
|
- Implement lifecycle hooks with onMounted, onUpdated, etc.
|
||||||
"Implement lifecycle hooks with onMounted, onUpdated, etc.",
|
- Utilize provide/inject for dependency injection
|
||||||
"Utilize provide/inject for dependency injection",
|
- Use vue 3.5 style of default prop declaration. Example:
|
||||||
"Use vue 3.5 style of default prop declaration. Example:
|
|
||||||
|
|
||||||
|
```typescript
|
||||||
const { nodes, showTotal = true } = defineProps<{
|
const { nodes, showTotal = true } = defineProps<{
|
||||||
nodes: ApiNodeCost[]
|
nodes: ApiNodeCost[]
|
||||||
showTotal?: boolean
|
showTotal?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
```
|
||||||
|
|
||||||
",
|
- Organize vue component in <template> <script> <style> order
|
||||||
"Organize vue component in <template> <script> <style> order",
|
|
||||||
]
|
|
||||||
|
|
||||||
// Folder structure
|
## Project Structure
|
||||||
const folderStructure = `
|
```
|
||||||
src/
|
src/
|
||||||
components/
|
components/
|
||||||
constants/
|
constants/
|
||||||
@@ -30,30 +29,25 @@ src/
|
|||||||
services/
|
services/
|
||||||
App.vue
|
App.vue
|
||||||
main.ts
|
main.ts
|
||||||
`;
|
```
|
||||||
|
|
||||||
// Tailwind CSS best practices
|
## Styling Guidelines
|
||||||
const tailwindCssBestPractices = [
|
- Use Tailwind CSS for styling
|
||||||
"Use Tailwind CSS for styling",
|
- Implement responsive design with Tailwind CSS
|
||||||
"Implement responsive design with Tailwind CSS",
|
|
||||||
]
|
|
||||||
|
|
||||||
// PrimeVue deprecated components - DO NOT USE
|
## PrimeVue Component Guidelines
|
||||||
const deprecatedPrimeVueComponents = [
|
DO NOT use deprecated PrimeVue components. Use these replacements instead:
|
||||||
"DO NOT use deprecated PrimeVue components. Use these replacements instead:",
|
- Dropdown → Use Select (import from 'primevue/select')
|
||||||
"Dropdown → Use Select (import from 'primevue/select')",
|
- OverlayPanel → Use Popover (import from 'primevue/popover')
|
||||||
"OverlayPanel → Use Popover (import from 'primevue/popover')",
|
- Calendar → Use DatePicker (import from 'primevue/datepicker')
|
||||||
"Calendar → Use DatePicker (import from 'primevue/datepicker')",
|
- InputSwitch → Use ToggleSwitch (import from 'primevue/toggleswitch')
|
||||||
"InputSwitch → Use ToggleSwitch (import from 'primevue/toggleswitch')",
|
- Sidebar → Use Drawer (import from 'primevue/drawer')
|
||||||
"Sidebar → Use Drawer (import from 'primevue/drawer')",
|
- Chips → Use AutoComplete with multiple enabled and typeahead disabled
|
||||||
"Chips → Use AutoComplete with multiple enabled and typeahead disabled",
|
- TabMenu → Use Tabs without panels
|
||||||
"TabMenu → Use Tabs without panels",
|
- Steps → Use Stepper without panels
|
||||||
"Steps → Use Stepper without panels",
|
- InlineMessage → Use Message component
|
||||||
"InlineMessage → Use Message component"
|
|
||||||
]
|
|
||||||
|
|
||||||
// Additional instructions
|
## Development Guidelines
|
||||||
const additionalInstructions = `
|
|
||||||
1. Leverage VueUse functions for performance-enhancing styles
|
1. Leverage VueUse functions for performance-enhancing styles
|
||||||
2. Use lodash for utility functions
|
2. Use lodash for utility functions
|
||||||
3. Use TypeScript for type safety
|
3. Use TypeScript for type safety
|
||||||
@@ -63,7 +57,5 @@ const additionalInstructions = `
|
|||||||
7. Implement proper error handling
|
7. Implement proper error handling
|
||||||
8. Follow Vue 3 style guide and naming conventions
|
8. Follow Vue 3 style guide and naming conventions
|
||||||
9. Use Vite for fast development and building
|
9. Use Vite for fast development and building
|
||||||
10. Use vue-i18n in composition API for any string literals. Place new translation
|
10. Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
|
||||||
entries in src/locales/en/main.json.
|
|
||||||
11. Never use deprecated PrimeVue components listed above
|
11. Never use deprecated PrimeVue components listed above
|
||||||
`;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user