prefer-unknown-over-any
Installation
SKILL.md
Use unknown Instead of any for Values with an Unknown Type
Overview
unknown is the type-safe cousin of any.
When you don't know a value's type, use unknown. It forces you to narrow the type before using it, preventing bugs that any would allow.
When to Use This Skill
- Parsing JSON or YAML
- Receiving data from external sources
- Working with user input
- Writing functions that accept anything
- Replacing any with something safer