# Coding Conventions **Analysis Date:** 2026-07-29 ## Naming Patterns **Files:** - TypeScript/Vue: PascalCase for components (e.g., `ToggleSwitch.vue`, `SendBitcoinModal.vue`), camelCase for composables and stores (e.g., `useFileType.ts`, `controller.ts`) - Rust: snake_case for modules and files (e.g., `bitcoin_rpc.rs`, `storage_crypto.rs`) - Test files: co-located with source in `__tests__/` subdirectories with `.test.ts` or `.spec.ts` suffix for Vitest, `.bats` for shell tests - Constants in TypeScript use UPPER_SNAKE_CASE within modules (e.g., `IMAGE_EXTS`, `CATEGORY_COLORS` in `useFileType.ts`) **Functions:** - TypeScript/Vue: camelCase for all functions (e.g., `getFileCategory`, `formatSize`, `useFileType`) - Composables: `use` prefix for Vue composables (e.g., `useFileType`, `useToast`, `useMessageToast`) — exported as named exports or default exports - Store functions (Pinia): defined with snake_case action names, exported from `defineStore` factory - Rust: snake_case for all functions and methods (e.g., `doesnt_reallocate`, following Rust conventions) **Variables:** - TypeScript: camelCase for local variables and reactive refs (e.g., `modelValue`, `isActive`, `gamepadCount`) - Refs (Vue 3): prefix not required, but convention is lowercase start (e.g., `const ext = ref('jpg')`) - Computed properties: camelCase, explicit `.value` suffix in templates when needed - Parameters: camelCase, typed explicitly in TypeScript (e.g., `password: string`, `isDir: Ref`) **Types:** - TypeScript: PascalCase for type aliases and interfaces (e.g., `RPCOptions`, `FileCategory`, `CatalogVersionInfo`) - Union types: PascalCase (e.g., `PendingState = 'pending' | 'sent' | 'approved'`) - Component props: typed with `defineProps<{ ... }>()` syntax in `