You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce and apply a consistent function style across the codebase: use arrow functions for all non-component code (helpers, API functions, handlers, mappers, hooks, async functions), and function declarations for React components and anything that returns JSX. A Cursor rule (.cursor/rules/function-style.mdc) documents the convention, and ESLint is updated to enforce it.
Proposed solution
Use const name = (params): ReturnType => { ... } (or export const name = ...) for non-component code; use export const name = async (...) => ... for async.
Use function ComponentName(props) for React components, subcomponents, and providers (e.g. pages, modals, DataBoundary, NotificationProvider).
Add .cursor/rules/function-style.mdc describing the convention.
Extend eslint.config.js to enforce the chosen styles.
Refactor apps/api and apps/web to follow the convention (controllers, services, repositories, DTOs, API client, hooks, components, mocks).
Acceptance criteria
Function style rule is documented in .cursor/rules/function-style.mdc.
ESLint config enforces arrow functions for non-components and function declarations for React components.
All API code (NestJS controllers, services, repositories, guards, interceptors, filters, config, mappers, DTOs) uses the arrow-function style where applicable.
All web code (API client, error handler, hooks, helpers, mocks) uses arrow functions; React components use function declarations.
Explicit return types and type annotations are preserved where they existed.
Existing behavior is unchanged; refactor is style-only.
Description
Introduce and apply a consistent function style across the codebase: use arrow functions for all non-component code (helpers, API functions, handlers, mappers, hooks, async functions), and function declarations for React components and anything that returns JSX. A Cursor rule (
.cursor/rules/function-style.mdc) documents the convention, and ESLint is updated to enforce it.Proposed solution
const name = (params): ReturnType => { ... }(orexport const name = ...) for non-component code; useexport const name = async (...) => ...for async.function ComponentName(props)for React components, subcomponents, and providers (e.g. pages, modals,DataBoundary,NotificationProvider)..cursor/rules/function-style.mdcdescribing the convention.eslint.config.jsto enforce the chosen styles.apps/apiandapps/webto follow the convention (controllers, services, repositories, DTOs, API client, hooks, components, mocks).Acceptance criteria
.cursor/rules/function-style.mdc.functiondeclarations.Additional context
Branch:
refactor/function-style