conditional-types-over-overloads
✓Use when typing functions with multiple return types. Use when function behavior depends on input type. Use when dealing with union type inputs. Use when considering function overloads.
SKILL.md
When a function's return type depends on its input type, you might reach for overload signatures. However, conditional types often provide a better solution. Unlike overloads, which are checked independently, conditional types distribute over unions and can be analyzed as a single expression. This makes them more powerful for handling union inputs and results in more maintainable type declarations.
Understanding when to use conditional types versus overloads is key to writing flexible, correct type signatures.
Prefer conditional types to overloaded signatures. Conditional types distribute over unions and provide more precise, maintainable type declarations.
Use when typing functions with multiple return types. Use when function behavior depends on input type. Use when dealing with union type inputs. Use when considering function overloads. Source: marius-townhouse/effective-typescript-skills.
Facts (cite-ready)
Stable fields and commands for AI/search citations.
- Install command
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill conditional-types-over-overloads- Category
- </>Dev Tools
- Verified
- ✓
- First Seen
- 2026-02-05
- Updated
- 2026-02-18
Quick answers
What is conditional-types-over-overloads?
Use when typing functions with multiple return types. Use when function behavior depends on input type. Use when dealing with union type inputs. Use when considering function overloads. Source: marius-townhouse/effective-typescript-skills.
How do I install conditional-types-over-overloads?
Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill conditional-types-over-overloads Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor
Where is the source repository?
https://github.com/marius-townhouse/effective-typescript-skills
Details
- Category
- </>Dev Tools
- Source
- skills.sh
- First Seen
- 2026-02-05