Skip to Content
OpenPerf

Conventions

Frontend

File naming and styling rules for apps/web, apps/web-corpsite and packages/deft.

Files

FileName
React componentPascalCase: TracePage.tsx
Anything elsecamelCase, matching its export: useOrganization.ts
Directorykebab-case: components/copy-button/

Suffixes stay as they are: .test.ts, .server.ts, .isomorph.ts. Routes in apps/web/src/routes/ and apps/web-corpsite/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 cn strings as arguments, simple string first and className last. tv uses arrays with the same grouping.
  • A plain className string is fine only while every class is simple; otherwise use cn.
  • Compose with cn, never template literals. Group a conditional block in a nested cn.
cn("relative flex items-center gap-2", "hover:bg-control-hover", "[&_svg]:size-4", className);

On this page