All commands must be run inside Nix for this repository.
If already running inside a Nix environment, run commands directly and do not start a nested nix develop.
Otherwise:
- Interactive shell pattern:
nix develop(preferred) - One-shot command pattern:
nix develop --command <cmd ...>(adds delay for each invocation)
- Run tests:
yarn workspace [lib|web|keyserver|native] test - Test all packages:
yarn jest:all - Run lint:
yarn eslint:all - Fix lint issues:
yarn eslint:fix - Check Flow types:
yarn flow:alloryarn workspace [workspace] flow - Run dev server:
yarn workspace [workspace] dev - Clean install:
yarn cleaninstall
- Use Flow for static typing with strict mode enabled
- Always include
// @flowannotation at the top of JS files - Export types with explicit naming:
export type MyType = {...}
- Prettier with 80-char line limit
- Single quotes, trailing commas
- Arrow function parentheses avoided when possible
- React component files named *.react.js
- kebab-case for filenames (enforced by unicorn/filename-case)
- Descriptive variable names
- Group imports with newlines between builtin/external and internal
- Alphabetize imports within groups
- No relative imports between workspaces - use workspace references
- Use functional components with hooks
- Follow exhaustive deps rule for useEffect/useCallback
- Component props should use explicit Flow types
- Use consistent returns in functions
- Handle all promise rejections
- Prefer async IIFEs with
try/catch/finallyover.then()/.catch()/.finally()chains
- Before reporting back after code changes, review your diff and remove low-signal churn such as opinionated renames, unnecessary variable reshuffles, comment-only deletions, or other non-pertinent edits
- Match the existing repo commit message style by checking recent
git logbefore committing when the pattern is not obvious - Use the repo's bracketed scope format when applicable, such as
[terraform] Short imperative sentence case