domain:typescript
CommunityEnforce TypeScript best practices and standards.
Software Engineering#typescript#testing#dependencies#conventions#type-safety#error-handling#project-structure
AuthorTheCactusBlue
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Consolidates TypeScript project conventions to ensure consistent type safety, robust testing, and standardized error handling across codebases.
Core Features & Use Cases
- Enforce strict mode in tsconfig.json — no exceptions
- Prefer const over let; never use var
- Use discriminated unions for state modeling over class hierarchies
- Prefer unknown over any — narrow types explicitly
- Use readonly on properties and arrays that should not be mutated
- Prefer interface for object shapes, type for unions and intersections
- Use template literal types for string patterns where useful
- Prefer satisfies operator to validate types without widening
- Project structure: src directory, path aliases, barrel exports, colocate tests and types
- Testing: vitest as the test framework; colocate tests with sources
- Error Handling: typed error classes with a code; Result pattern; validate external input with zod
- Dependencies: zod for runtime validation, date-fns for dates, native fetch or ofetch, eslint + prettier, tsup for libraries, vite for applications
- Anti-patterns: avoid any, avoid deep barrel exports, avoid mutable shared state
Quick Start
Apply the conventions by enabling strict mode in tsconfig.json, preferring const over let, using unknown over any, and adopting vitest tests with zod validations.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: domain:typescript Download link: https://github.com/TheCactusBlue/nixfiles/archive/main.zip#domain-typescript Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.