No canonical snake_case/camelCase serialization policy
This commit is contained in:
@@ -966,6 +966,15 @@ This pattern prevents **stale session flicker** — the brief moment when a user
|
||||
| Directories | lowercase kebab‑case or camelCase | `components/`, `hooks/` |
|
||||
| Boolean props/variables | `is`/`has`/`should` prefix | `isLoading`, `hasError` |
|
||||
|
||||
### API Field Names — snake_case
|
||||
|
||||
All TypeScript interface properties that mirror backend API responses use **`snake_case`**, not `camelCase`. This matches the JSON wire format emitted by the backend without any transformation layer.
|
||||
|
||||
- ✅ `active_jails`, `total_bans`, `log_level`, `db_purge_age`
|
||||
- ❌ `activeJails`, `totalBans`, `logLevel`, `dbPurgeAge` (do **not** use camelCase for API shapes)
|
||||
|
||||
This applies to all interfaces in `src/types/`. Internal component state, props, and hook return values use `camelCase` as normal TypeScript convention.
|
||||
|
||||
---
|
||||
|
||||
## 9. Linting & Formatting
|
||||
|
||||
Reference in New Issue
Block a user