| description | Coding conventions — read when writing or reviewing any code file |
|---|
- Use TypeScript strict mode (
"strict": truein tsconfig) - Use Zod only at user-input boundaries (settings form) — not for internal types
- Use named constants — never magic numbers or strings
- Keep components focused; co-locate sub-components in the same file if < 80 lines
- Use
typeimports for framer-motion'sVariantstype to avoid widening issues - Cast TanStack Router
paramsasas neverfor cross-route navigation
- Use
any— useunknownand narrow explicitly - Inline Honcho base URL — always read from
loadConfig()insrc/lib/config.ts - Use Tailwind color classes for theme-sensitive values — use CSS
var(--*)instead - Use
React.FormEvent(deprecated in TS6) — useReact.SyntheticEvent<HTMLFormElement> - Add
as constto framer-motion variant objects — annotate withconst x: Variants = {}
- One assertion per test case
- Test behavior, not implementation
- Run targeted:
pnpm vitest run src/path/to/file.test.ts - Never mock internal modules — mock only external API boundaries (openapi-fetch client)
- All data fetching via TanStack Query hooks in
src/api/queries.ts - POST body shapes are fixed per the openapi schema — do not guess field names
- Use
client.current(getter) to always get fresh config at call time