Unified naming conventions for variables, files, and identifiers across the codebase
Целевые файлы
Файл
Формат
.cursorrules
plaintext
CLAUDE.md
markdown
Содержимое
Use camelCase for variables and functions in JavaScript/TypeScript, Python uses snake_case.
Use PascalCase for classes, interfaces, types, React components, and Vue SFCs everywhere.
Use SCREAMING_SNAKE_CASE for constants and environment variable names.
Name booleans with is/has/can/should prefix: isLoading, hasError, canEdit, shouldRetry.
Name event handlers with on prefix: onClick, onSubmit, onUserCreated.
Name async functions descriptively; avoid get/fetch ambiguity — use fetchUser, loadConfig.
Name files to match their default export: UserCard.tsx, useAuth.ts, user-service.ts.
Use kebab-case for file names in non-component code, URL slugs, and CSS class names.
Avoid abbreviations unless universally known (id, url, api, db); write out everything else.
Avoid single-letter variable names outside loop counters (i, j) and math functions.
Name database tables and columns in snake_case (user_id, created_at) consistently.
Prefix private class members with # (TS/JS private fields) or _ (language convention).
Use plural names for arrays and collections: users, orderIds, selectedItems.
Name test files by appending .test or .spec to the subject file: auth.service.test.ts.