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
{{ message }}
Repository navigation
Enforce the React component typing convention with lint #1207
Review on #1205 suggested typing components with React.FC and returning React.ReactNode. The repo already follows a different convention, but only by habit, so it is easy to drift from it either way.
Current convention
Components are plain functions. React.FC is used nowhere.
52 component files return React.JSX.Element. ReactNode appears only where a component can return null or non-element nodes (for example Tooltip).
@repo/ui annotates the return type of every exported component. The panel packages mostly do not: 25 files with exported components have no return type (17 in packages/tasks, 8 in packages/workspaces).
Proposal
oxlint 1.92 can enforce most of this:
typescript/no-restricted-types: ban React.FC, FC, and React.FunctionComponent, with a message pointing at plain function components.
typescript/explicit-module-boundary-types: require explicit return types on exported functions, starting with packages/ui (already compliant) and then the panel packages once their 25 files are annotated.
Document the React.JSX.Element vs ReactNode rule in packages/AGENTS.md: return React.JSX.Element unless the component can return null or other non-element nodes. Lint cannot tell those apart, so this part stays a written rule.
Check the React Compiler output after annotating, since return types do not change what it compiles.
Activity
linear-code commentedon Nov 19, 2026
VSC-53