typescript
Installation
SKILL.md
TypeScript Best Practices
Scope
Apply these conventions across TypeScript code. Favor existing repo patterns and tooling before introducing new ones.
Prefer parameter objects
- Define functions with a single
params: { ... }argument to keep call sites readable and extensible. - Group related inputs under descriptive keys; avoid long positional argument lists.
- For React hooks/components, align the parameter object shape with the exported type to preserve editor hints.
Use function name() instead of const name = () => {}
- Declare functions with the
functionkeyword.
Keep functions small and composable
- Keep functions focused and well named; prefer breaking flows into smaller helpers rather than monolithic handlers.
- Compose small helpers to express intent; aim for single-responsibility business logic that reads like a narrative.
Keep files small
- As files grow large, try to break them up into smaller composable files