React
Functional components only
Always use TSX functional components with named exports.Özellikler
Create a type named{ComponentName}Props. Use destructuring. Don’t use React.FC.
No single-variable prop spreading
Durum Yönetimi
Jotai atoms for global state
- Prefer atoms over prop drilling
- Don’t use
useReffor state — useuseStateor atoms - Use atom families and selectors for lists
Avoid unnecessary re-renders
- Extract
useEffectand data fetching into sibling sidecar components - Prefer event handlers (
handleClick,handleChange) overuseEffect - Don’t use
React.memo()— fix the root cause instead - Limit
useCallback/useMemousage
TypeScript
typeoverinterface— more flexible, easier to compose- String literals over enums — except for GraphQL codegen enums and internal library APIs
- No
any— strict TypeScript enforced - No type imports — use regular imports (enforced by Oxlint
typescript/consistent-type-imports) - Use Zod for runtime validation of untyped objects
JavaScript
İsimlendirme
- Variables: camelCase, descriptive (
emailnotvalue,fieldMetadatanotfm) - Constants: SCREAMING_SNAKE_CASE
- Types/Classes: PascalCase
- Files/directories: kebab-case (
.component.tsx,.service.ts,.entity.ts) - Event handlers:
handleClick(notonClickfor the handler function) - Component props: prefix with component name (
ButtonProps) - Styled components: prefix with
Styled(StyledTitle)
Stil
Use Linaria styled components. Use theme values — avoid hardcodedpx, rem, or colors.
İçe Aktarımlar
Use aliases instead of relative paths:Folder Structure
- Modules can import from other modules, but
ui/should stay dependency-free - Use
internal/subfolders for module-private code - Components under 300 lines, services under 500 lines