typescript-types

Enforce TypeScript type safety using tsc strict mode and no-unsafe ESLint rules.

1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/pnewsam/skills --skill typescript-types-pnewsam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript-types
Source: https://github.com/pnewsam/skills/tree/main/archive/registry-rebuild/typescript-types
Command: npx skills add https://github.com/pnewsam/skills --skill typescript-types-pnewsam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript codebases often accumulate unsafe escape hatches like any types and unchecked as casts that silently defeat the type system. This Skill defines type-safety objectives and the deterministic compiler and lint checks that mechanically verify them, so unsafe patterns are caught as defects instead of slipping through review. ## Core Features & Use Cases - Deterministic Verification: Uses tsc --noEmit with strict mode and type-checked @typescript-eslint rules (no-explicit-any, no-unsafe-*, consistent-type-assertions, switch-exhaustiveness-check) as the ground-truth gate. - Type Modeling Objectives: States requirements for discriminated unions, as const/satisfies derivations, branded nominal types, and enforced exhaustiveness so invalid states are unrepresentable. - Use Case: When writing or reviewing type definitions for a new API response with multiple variants, model the data as a discriminated union, then run the strict compiler and no-unsafe lint to confirm no any or unsafe cast was introduced. ## Quick Start Review my TypeScript type definitions for the order status variants and verify they pass tsc strict mode and the no-unsafe ESLint rules.

Frequently Asked Questions about typescript-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce strict TypeScript type checking in a project?▼

Enable strict mode in tsconfig (noImplicitAny, strictNullChecks, exactOptionalPropertyTypes) and run tsc --noEmit as a gate. Add type-checked @typescript-eslint rules like no-explicit-any and the no-unsafe family to catch escape hatches the compiler misses.

How to model data variants in TypeScript without optional fields?▼

Use a discriminated union keyed on a literal discriminant, where each variant carries only its own data. This makes invalid states unrepresentable, unlike one interface with mutually exclusive optional fields.

What ESLint rules catch unsafe TypeScript type assertions?▼

The type-checked @typescript-eslint config with no-explicit-any, no-unsafe-assignment, no-unsafe-argument, no-unsafe-call, no-unsafe-member-access, no-unsafe-return, and consistent-type-assertions flags any usage and as casts. Replace any with unknown plus narrowing, and as casts with type guards.

Does TypeScript enforce switch exhaustiveness on union types?▼

Not by default; enable the switch-exhaustiveness-check ESLint rule so every discriminated union variant must be handled. A new variant then fails the check until handled, or you add an explicit never check.

When should I use branded types in TypeScript?▼

Use branded or nominal types when mixing two domains is a real bug, such as ids or units. A branded type makes a wrong-domain value a compile error at no runtime cost.