
Typescript Strict Mode
This is essentially a reference guide you'll want around if you're enforcing strict TypeScript rules, especially in codebases with no-explicit-any enabled. It walks through practical alternatives to using any (unknown, generics, union types, type guards), covers common event handler types for React and DOM, and includes patterns for promises, callbacks, and utility types. The examples are concrete and show both wrong and correct approaches, which is helpful when you're staring at a type error. It's not going to teach you TypeScript from scratch, but if you keep reaching for any out of frustration or uncertainty, this gives you the specific patterns to use instead. Treats type assertions with appropriate suspicion and includes a solid section on discriminated unions for handling multiple related types safely.
- skills.sh installs
- 156
- GitHub stars
- 16
- last updated
- Jun 3, 2026
Install
$ npx -y skills add fluid-tools/claude-skills --skill typescript-strict-mode --agent claude-codeInstalls into .claude/skills of the current project.
Files
TypeScript Strict Mode Best Practices
Overview
This skill covers strict TypeScript practices applicable across all frameworks. It focuses on avoiding any, using proper type annotations, and leveraging TypeScript's type system for safer, more maintainable code.
The Golden Rule: NEVER Use any
CRITICAL RULE: Many codebases have @typescript-eslint/no-explicit-any enabled. Using any will cause build failures.
Why any is dangerous:
- Defeats the purpose of TypeScript's type system
- Hides bugs that would be caught at compile time
- Propagates type unsafety through the codebase
- Makes refactoring difficult and error-prone
Alternatives to any
1. Use Specific Types
❌ WRONG:
function processData(data: any) { ... }
const items: any[] = [];
✅ CORRECT:
function processData(data: { id: string; name: string }) { ... }
const items: string[] = [];
2. Use unknown When Type is Truly Unknown
unknown is the type-safe counterpart to any. It forces you to narrow the type before using it.
❌ WRONG:
Sponsors
Details
- Repository
- github.com/fluid-tools/claude-skills
- First seen
- Jun 3, 2026