evolving-types
Installation
SKILL.md
Understand Evolving Types
Overview
Some variables start with broad types and narrow as TypeScript sees values added.
This is an exception to the rule that types don't change. Variables initialized without a value, or as empty arrays, can have "evolving" types that narrow based on what you assign to them.
When to Use This Skill
- Variables initialized to
nullorundefined - Arrays that start empty and get values pushed
- Variables that start as
anyand narrow - Understanding when explicit annotations are better