This repository uses a single, root ESLint configuration to enforce TypeScript and React best-practices across both the client and server packages.
See the active config at .eslintrc.cjs and the ignore patterns at .eslintignore.
- Parser:
@typescript-eslint/parserwithtsconfigRootDirset to the repo root. - Plugins:
@typescript-eslint,import,react,react-hooks. - Extends:
eslint:recommended,plugin:@typescript-eslint/recommended,plugin:import/recommended,plugin:import/typescript,plugin:react/recommended. - Import resolver is configured for TypeScript projects so path resolution
works across
packages/*/tsconfig.json.
@typescript-eslint/explicit-module-boundary-types: error- Requires explicit return types on exported functions/exports. This aligns with the repo's TypeScript guideline to keep public API types explicit.
@typescript-eslint/no-explicit-any: error- Disallows
anyexcept where explicitly permitted by overrides (config files and some test helpers). Preferunknown+ type-guards instead.
- Disallows
@typescript-eslint/triple-slash-reference: error- Enforces using
importstyle typing for tests (Vitest) rather than triple-slash references.
- Enforces using
@typescript-eslint/no-unused-varswith_-prefix ignore- Allows intentionally unused args/vars when prefixed with
_.
- Allows intentionally unused args/vars when prefixed with
no-console: ['warn', { allow: ['warn','error'] }]- Console is warned by default but allowed for
warn/error. The server override further relaxes this to support logging middleware.
- Console is warned by default but allowed for
import/no-unresolved: error- Ensures imports resolve correctly; some import checks are pragmatically disabled in overrides where false-positives occurred.
-
packages/client/src/**/*.{ts,tsx}env: browser/node. Type-aware linting usespackages/client/tsconfig.json.- Disables
import/no-named-as-default-memberwhere it produced false positives for certain imports.
-
packages/server/src/**/*.{ts,tsx}env: node. Type-aware linting usespackages/server/tsconfig.json.- Pragmatic relaxations: allow CommonJS
requireusage in a few places, disable someimport/*checks that produced false positives, and allowconsolefor structured logging in middleware/services.
-
Tests:
**/*.test.ts,**/*.test.tsx,tests/**- Test environment uses standard ES2021 globals;
import/no-extraneous-dependenciesis turned off for test files.
- Test environment uses standard ES2021 globals;
-
Config files (
**/*.config.ts,**/*vite*.ts,**/*vitest*.ts,**/*tailwind*.ts)- These files are excluded from the strict
no-explicit-anyrule to ease interop with tooling configs (the codebase still prefers typed configs where practical).
- These files are excluded from the strict
- Root ESLint config: .eslintrc.cjs
- Ignore file: .eslintignore
- Root dev dependencies: package.json
- Client lint script: packages/client/package.json
- Server lint script: packages/server/package.json
Install deps (if not already installed):
npm installRun the workspace lint scripts (this runs per-package lint commands):
npm run lintAutofix common issues across the repo:
npx eslint . --ext .ts,.tsx --fixIf you want to lint only a package (faster iteration):
npm run lint --workspace=packages/client
npm run lint --workspace=packages/server-
You may see a warning from
@typescript-eslintabout TypeScript version compatibility (this repo uses a newer TypeScript than the parser's tested range). To silence that and ensure deterministic behaviour, either:- Align
typescriptwith the tested versions for the installed@typescript-eslint/*packages, or - Upgrade
@typescript-eslint/*to a release that officially supports your TypeScript version.
- Align
-
The config enforces strict rules (no
any, explicit module boundaries). For quick progress, there are scoped overrides for tests and configuration files. Prefer fixing code to conform to the strict rules rather than widening overrides where possible. -
Some
import/*rules were temporarily relaxed in server/client overrides due to TypeScript resolver mismatches; if you add new path aliases or changetsconfiglayouts, update theimport/resolversettings in.eslintrc.cjsso stricter import rules can be re-enabled.
- Edit the root configuration at .eslintrc.cjs.
- Run
npx eslint . --ext .ts,.tsx --fixto apply automatic fixes. - Run
npm run lintto ensure both packages pass the rules (server runstsc --noEmitafter linting).