Skip to main content

Coding Standards

Last Verified: February 2026
The Equa platform repositories use different toolchains that evolved independently. This guide documents the actual state of each repository’s coding standards rather than presenting an idealized unified standard.

Standards at a Glance

Source: package.json and tsconfig.json files across repos
TSLint is deprecated and unmaintained. equa-web and equa-server still use it. An ESLint migration is recommended but has not been prioritized.

TypeScript Conventions

All repositories use TypeScript with strict: true enabled. Common rules that apply everywhere:
  • Avoid any — Use proper typing. If a type is unknown, prefer unknown and narrow it.
  • Prefer interfaces over type aliases for object shapes (consistency with existing code).
  • Use readonly for immutable properties where semantically appropriate.

equa-web / equa-server (CommonJS)

  • Module system: "module": "commonjs" in tsconfig
  • Decorators: "experimentalDecorators": true — used by TypeORM entities in equa-server and some patterns in equa-web
  • Target: ES6 (equa-web), ES2019 (equa-server)
Source: equa-web/tsconfig.json, equa-server/tsconfig.json

equabot-gateway (ESM)

  • Module system: "type": "module" in package.json
  • Target: Modern Node.js (22+)
  • LOC guideline: Aim to keep files under ~500 lines; split/refactor when it improves clarity
  • Strict typing enforced more aggressively than legacy repos
Source: equabot-gateway/package.json, equabot/CLAUDE.md coding style section

React Patterns

equa-web (Mixed Legacy and Modern)

equa-web has code spanning several years. You’ll encounter two patterns: Legacy (older modules):
  • Class components with React.Component
  • Redux for state management (src/logic/ contains the store)
  • connected-react-router for routing with Redux integration
  • react-final-form for form handling
Modern (newer code):
  • Functional components with hooks (useState, useEffect, useContext)
  • Local state preferred over Redux
  • React Router 5 for routing
Guideline: When writing new code in equa-web, prefer hooks and functional components. When modifying existing class components, match the existing pattern unless refactoring is the explicit goal.

equa-patternlib / command-center-so (Modern)

  • Functional components only
  • React hooks for all state management
  • No Redux

Styling

equa-web: styled-components 4.2

Components are styled using styled-components with a global ThemeProvider:
Theme variables are defined in equa-web/src/shared/styles/theme.ts. Always prefer theme variables over hardcoded values for colors, spacing, and typography. Global CSS styles: equa-web/src/shared/styles/global.ts Source: equa-web/README.md (lines 37-44)

equa-patternlib: styled-components 6.3

Same pattern but uses the newer styled-components API with React 18.

command-center-so: Tailwind CSS 4

Uses utility-first CSS classes. No styled-components.

Linting and Formatting

equa-web

Config: equa-web/tslint.json extends tslint:recommended with Prettier integration. Source: equa-web/package.json scripts

equa-server

Config: equa-server/tslint.json uses tslint-config-prettier. Source: equa-server/package.json scripts

equabot-gateway

Uses Oxlint for linting and Oxfmt for formatting. Run pnpm lint before commits. Source: equabot-gateway/package.json scripts

equa-patternlib / command-center-so

File Organization

Module Pattern (equa-web)

Each feature lives in its own module under src/modules/:

Workspace Module Pattern (equa-server)

Each module is a separate Yarn workspace package:
The api module registers all endpoint handlers. The persistence module owns all database entities and queries. Other modules reference persistence for data access.

Colocated Tests (equabot-gateway)

Tests live alongside the code they test:

Naming Conventions

These are observed patterns, not enforced rules:

Recommendations

  1. Migrate equa-web and equa-server from TSLint to ESLint — TSLint has been deprecated since 2019. ESLint with @typescript-eslint is the modern standard.
  2. Standardize on a single formatting tool — Currently a mix of Prettier (via TSLint), Oxfmt, and no formatter. Consider Prettier or Biome across all repos.
  3. Adopt consistent path aliases — equa-web has path aliases; equa-server does not. Consistent @ aliases would improve readability.