mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-27 11:29:53 +00:00
Amp-Thread-ID: https://ampcode.com/threads/T-019bdfa7-58b4-731b-83ee-83f2b2bea030 Co-authored-by: Amp <amp@ampcode.com>
1.1 KiB
1.1 KiB
globs
| globs | |||
|---|---|---|---|
|
Code Style
Formatting (via oxfmt)
- 2-space indent
- Single quotes
- No trailing semicolons
- 80 character width
Run pnpm format before committing.
Imports
Use separate import type statements:
// ✅ Correct
import type { Foo } from './foo'
import { bar } from './foo'
// ❌ Wrong
import { bar, type Foo } from './foo'
Naming
- Vue components:
PascalCase.vue(e.g.,MenuHamburger.vue) - Composables:
useXyz.ts - Pinia stores:
*Store.ts
Code Organization
- Minimize exported surface area per module
- No barrel files (
index.tsre-exports) withinsrc/ - Prefer function declarations over function expressions
- Keep functions short and focused
- Minimize nesting (avoid arrow anti-pattern)
- Favor immutability and pure functions
Comments
Code should be self-documenting. Avoid comments unless absolutely necessary. If you must comment, explain why, not what.
Libraries
- Use
es-toolkitfor utilities (not lodash) - Use
VueUsefor reactive utilities - Avoid new PrimeVue component usage
- Use vue-i18n for all user-facing strings