Frontend
File naming and styling rules for apps/web and packages/deft.
Files
| File | Name |
|---|---|
| React component | PascalCase: TracePage.tsx |
| Anything else | camelCase, matching its export: useOrganization.ts |
| Directory | kebab-case: components/copy-button/ |
Suffixes stay as they are: .test.ts, .server.ts, .isomorph.ts. Routes in apps/web/src/routes/ follow TanStack Start’s names instead.
No JSDoc on components or their props.
Classes
local/split-tailwind-classes enforces this and bun run check:fix applies it.
- Simple classes share one string. A class with a variant (
hover:,md:,data-*:,[&…]:) or an arbitrary value gets its own string. - Pass
cnstrings as arguments, simple string first andclassNamelast.tvuses arrays with the same grouping. - A plain
classNamestring is fine only while every class is simple; otherwise usecn. - Compose with
cn, never template literals. Group a conditional block in a nestedcn.
cn("relative flex items-center gap-2", "hover:bg-control-hover", "[&_svg]:size-4", className);