- Prefer dependent aliases over duplicated external shapes. Use utility types such as
Parameters,Awaited,NonNullableetc for this. - Avoid hand-maintained partial copies of external API types when a stable plugin-exported type can express the relationship.
- Do not create named argument object types when the argument is used by only one function or method; keep that object type inline at the parameter.
- Only create named types for reusable state, exported domain shapes, or types that other types are intentionally derived from.
- Do not add explicit return types by default. Use inference unless the function is a critical boundary where the return type is part of the contract.
- When checking an object against an interface without forcing an explicit return annotation, prefer
satisfies. - Do not wrap single built-ins or one-line property math in helper functions; e.g. having a helper like
stringifythat just doesJSON.stringifyinside.
- Run
pnpm run formatandpnpm run buildafter edits.