no-null-in-aliases
CommunityMake nullability explicit at the usage boundary.
Software Engineering#typescript#refactoring#readability#coding-standards#type-aliases#nullability#usage-boundary
Authorluyi985
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Type aliases should represent actual values and not be used to hide nullability. They can obscure nullability and lead to runtime errors. When you read User, you expect a user - not maybe-a-user. Include null explicitly at usage sites instead of hiding it in type aliases.
Core Features & Use Cases
- Clear nullability at usage sites: prefer User | null at the point of use.
- Avoid ambiguous type aliases: keep top-level types without | null and handle nullability where needed.
- Refactoring safety: easier reading and safer code when nullability is explicit.
- Use case examples: when defining type aliases for API responses or domain models, ensure that nullability is explicit at the usage boundary.
Quick Start
Review your type aliases and replace any pattern like Type = { ... } | null with a plain type and use Type | null where needed.
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: no-null-in-aliases Download link: https://github.com/luyi985/lyi-bash/archive/main.zip#no-null-in-aliases 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 471,000+ vetted skills library on demand.