avoiding-non-null-assertions

Community

Avoid '!' to protect type safety.

Authordjankies
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The non-null assertion operator (!) bypasses TypeScript's safety checks and can lead to runtime errors. This Skill promotes safer alternatives like optional chaining, nullish coalescing, and type guards.

Core Features & Use Cases

  • Safe alternatives to ! (optional chaining, nullish coalescing)
  • Type guards to narrow types safely
  • Early returns and assertion functions for explicit safety

Quick Start

Replace uses of ! with safe alternatives and add a type guard for runtime safety.

Dependency Matrix

Required Modules

None required

Components

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: avoiding-non-null-assertions
Download link: https://github.com/djankies/claude-configs/archive/main.zip#avoiding-non-null-assertions

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository