- To regenerate the JavaScript SDK, run
./packages/sdk/js/script/build.ts. - ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.
- The default branch in this repo is
dev.
- Keep things in one function unless composable or reusable
- Avoid unnecessary destructuring. Instead of
const { a, b } = obj, useobj.aandobj.bto preserve context - Avoid
try/catchwhere possible - Avoid using the
anytype - Prefer single word variable names where possible
- Use Bun APIs when possible, like
Bun.file()
We don't like let statements, especially combined with if/else statements.
Prefer const.
Good:
constfoo=condition ? 1 : 2Bad:
letfooif(condition)foo=1elsefoo=2Prefer early returns or using an iife to avoid else statements.
Good:
functionfoo(){if(condition)return1return2}Bad:
functionfoo(){if(condition)return1elsereturn2}Try your best to find a single word name for your variables, functions, etc. Only use multiple words if you cannot.
Good:
constfoo=1constbar=2constbaz=3Bad:
constfooBar=1constbarBaz=2constbazFoo=3You MUST avoid using mocks as much as possible.
Tests MUST test actual implementation, do not duplicate logic into a test.