Skip to content

Commit 8f825c0

Browse files
[docs] add code quality guidelines for i18n, async cleanup, and error handling (#4305)
1 parent e6f90e3 commit 8f825c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CLAUDE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
- Use Suspense for async components
3333
- Implement proper error handling
3434
- Follow Vue 3 style guide and naming conventions
35-
- Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json.
35+
- IMPORTANT: Use vue-i18n for ALL user-facing strings - no hard-coded text in services/utilities. Place new translation entries in src/locales/en/main.json
3636
- Avoid using `@ts-expect-error` to work around type issues. We needed to employ it to migrate to TypeScript, but it should not be viewed as an accepted practice or standard.
3737
- DO NOT use deprecated PrimeVue components. Use these replacements instead:
3838
* `Dropdown` → Use `Select` (import from 'primevue/select')
@@ -52,3 +52,7 @@
5252
- Templates: `api.fileURL('/templates/default.json')`
5353
- Extensions: `api.fileURL(extensionPath)` for loading JS modules
5454
- Any static assets that exist in the public directory
55+
- When implementing code that outputs raw HTML (e.g., using v-html directive), always ensure dynamic content has been properly sanitized with DOMPurify or validated through trusted sources. Prefer Vue templates over v-html when possible.
56+
- For any async operations (API calls, timers, etc), implement cleanup/cancellation in component unmount to prevent memory leaks
57+
- Extract complex template conditionals into separate components or computed properties
58+
- Error messages should be actionable and user-friendly (e.g., "Failed to load data. Please refresh the page." instead of "Unknown error")

0 commit comments

Comments
 (0)