Before finishing any change:
-
Format:
prettieron modified files -
If local:
tsc --noEmit <target>eslint <target>
-
If global:
pnpm run check-typespnpm run knip(fix unused code)
All checks must pass.
- Do not use
!(non-null assertion) - Use
invariantfor required values
-
Tests live next to the code
-
Naming:
*.e2e.test.ts→ requires Redis/Postgres*.test.ts→ otherwise
-
Use
factory.tsfor fixtures -
Use
test.extend(prefer one per file)
- Keep fixtures small, reusable, and independent
- Split by concern for parallelism
- Avoid shared global setup
- Avoid mocking unless necessary