Appearance
Coding Standards: OrbitTasks Engineering
Most of this is enforced by tools. The remainder is convention.
Auto-enforced (CI fails if violated)
- Formatting: Prettier with the project's
.prettierrc(once you add it this session; OrbitTasks ships without Prettier today, so runnpm install --save-dev prettierand add a.prettierrc). Pre-commit hook applies it; CI verifies. - Linting: ESLint with the project's
eslint.config.js. Pre-commit applies it (once you wire up the hook this session); CI verifies. - Type safety:
tsc --noEmitpasses. CI runs this as part of the build step. - Test coverage: Combined coverage across
apps/apiandapps/webmust be ≥ 70%.
Convention (review-enforced)
Naming:
- Files use
kebab-case.ts. - Variables and functions use
camelCase. - Types and interfaces use
PascalCase. - Constants meant as configuration use
SCREAMING_SNAKE_CASE.
- Files use
Imports: Sort grouping: node built-ins, npm packages, internal absolute paths, internal relative paths. Prettier handles within-group order.
Comments: Document why, not what. The what is in the code.
Errors: Throw typed errors. Don't return
nullfrom a function that can fail without saying so in the type.Tests: One assertion per logical thing.
describeblocks group by file/feature. Test names start with the behavior, not "should" (e.g.it('rejects an invalid email')).
What we don't enforce
- File length. A long file with good structure beats a short file with bad structure.
- Function length, beyond what's obvious in review.
- Specific comment density.
Why these and not more?
Every standard costs the team time. Each one above pays back consistently. We resist adding more without a specific case.
Last reviewed: [date]Owner: [name / team]