openchat openchat osschat

New Coding Standards and Banned Patterns

Documentation Frontend Bug Fix

This release adds clearer, centralized guidance for how to write React and TypeScript in this repo, with an emphasis on avoiding patterns that commonly lead to hard-to-debug behavior.

Coding standards now documented

A new Coding Standards & Banned Patterns section was added to provide explicit rules for contributors and AI agents, plus the reasoning behind them.

  • Bans direct useEffect usage, allowing useMountEffect() only for rare, justified external side effects
  • Bans TypeScript as any casts, recommending proper typing or narrowing from unknown
  • Requires deriving computed state inline (or with useMemo) instead of syncing state via effects
  • Requires using useQuery (or an equivalent data-fetching library) instead of fetching inside effects
  • Requires handling user actions in event handlers instead of effect-driven “action flag” patterns
  • Recommends resetting component state via the key prop instead of complex dependency-based reset logic

Discoverability from existing guidance

The existing ANTI-PATTERNS (THIS PROJECT) section now points back to these standards, making the rules easier to find when reviewing project do’s and don’ts.