mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
1.2 KiB
1.2 KiB
frontend — conventions (TypeScript)
All conventions in the root CLAUDE.md apply here. The naming and structure rules carry over; the
Python-only rules do not. Specifically:
- No leading
_on any name, and no barrels (index.tsthat only re-exports). - Single-purpose file naming — a one-export file is named after its export.
- Type everything under strict
tsconfig; model data with typed interfaces, not untyped objects (the TS equivalent of "no bare dicts"). - Comments are ONE line each, no exceptions (
//— never stack into a multi-line block); keep only WHY/gotcha, delete restating or dead-code comments. JSDoc blocks are exempt. - No gratuitous blank lines — never stack 2+ blanks; keep imports tight.
- Does not apply (Python-only):
@typechecked, pydanticBaseModel, the no-relative-imports rule (the frontend uses the@/path alias and local relative imports), andp-private.
Known gaps to fix over time, not perpetuate: no-underscore-names / p-private are currently
backend-only, and eslint.config.mjs still suggests a _ prefix to silence unused-variable
warnings — remove the unused binding instead of prefixing it.