typescript-coding-standards
TypeScript Coding Standards
Core Rules
- TS strict mode. Zero
any. Zero untyped exports. - Explicit return types on all exported functions.
- Interfaces for object shapes. Type aliases for unions/intersections.
- Async/await over raw promises. Always try/catch with typed errors.
- Optional chaining (?.) and nullish coalescing (??) over manual null checks.
- Never use non-null assertion (!) unless justified with a comment.
- const by default. let only when value changes. Never var.
- Destructuring for cleaner code. Template literals for string interpolation.
File Limits
- Functions: <40 lines. Extract if exceeding.
- Files: <300 lines. Split if exceeding.
- No dead code. No unused imports. No commented-out blocks.
More from cleanexpo/dr-nrpg
fact-checker
Verify factual accuracy of all claims, data, and information across the platform. Use when reviewing content, service descriptions, or business information for correctness.
1iicrc-validator
Validate IICRC standard references, certification claims, and technical terminology. Use when working on service pages, guides, or content that references IICRC standards.
1nrpg-workflow
Use when working on NRPG Platform tasks to follow repo conventions (NextAuth cookie sessions, tenant safety, and contractor privacy) and to run the correct checks.
1disaster-recovery-domain
Domain knowledge for Australian disaster recovery and restoration services. Use when working on content, service descriptions, or any feature related to the DR/NRPG business model.
1australian-business-validator
Validate Australian phone numbers, addresses, postcodes, ABN/ACN numbers, and state/territory references. Use when reviewing any content with Australian business data.
1