typescript-conventions
Applies TypeScript conventions: composition, small single-purpose functions, tests for new functions, and formatter and import-alias discipline.
- Group
- Conventions
- Kind
- Read-only
- Loads when
- Writing or reviewing TypeScript
When it runs
When TypeScript files are being written or reviewed. Claude loads it on its own when the description matches the file or the task; it never writes anything itself. It matches:
- TypeScript files
The conventions
- Strict mode stays on. Never turned off in
tsconfig.jsonto make a build pass. - Composition over inheritance.
- Small functions. One purpose per function, near 30 lines or fewer.
- Tests for new functions. Every new function and its edge cases, written the way testing-conventions describes.
- The formatter decides. Follow the quote style and formatting the project's formatter enforces.
- Import aliases. Use the project's configured import alias instead of long relative paths.
Related
- testing-conventions: how to write the tests.
- error-handling-conventions: errors in TypeScript.
- comments-conventions: why a small function needs no comment.