skills/modelscope.cn/consistent-aliases

consistent-aliases

SKILL.md

Be Consistent in Your Use of Aliases

Overview

If you create an alias, use it consistently.

When you assign an object property to a variable, you create an alias. TypeScript tracks them separately, so narrowing one doesn't narrow the other. Choose one and stick with it.

When to Use This Skill

  • Type narrowing isn't working as expected
  • Using both a variable and its source property
  • Property checks not affecting aliased variables
  • Refinements being "lost" after function calls

The Iron Rule

Installs
1
First Seen
13 days ago