·understand-type-widening
</>

understand-type-widening

Use when confused why TypeScript infers general types. Use when const vs let gives different types. Use when literals become string or number.

4Installs·0Trend·@marius-townhouse

Installation

$npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill understand-type-widening

How to Install understand-type-widening

Quickly install understand-type-widening AI skill to your development environment via command line

  1. Open Terminal: Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.)
  2. Run Installation Command: Copy and run this command: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill understand-type-widening
  3. Verify Installation: Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Source: marius-townhouse/effective-typescript-skills.

SKILL.md

View raw

When TypeScript infers a type from a value, it often widens it.

A variable initialized with "x" could be intended to hold any string, or just the literal "x". TypeScript guesses using heuristics, and understanding these helps you write predictable code.

If TypeScript infers a broader type than you expected, you're seeing widening.

Use when confused why TypeScript infers general types. Use when const vs let gives different types. Use when literals become string or number. Source: marius-townhouse/effective-typescript-skills.

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill understand-type-widening
Category
</>Dev Tools
Verified
First Seen
2026-02-26
Updated
2026-03-11

Browse more skills from marius-townhouse/effective-typescript-skills

Quick answers

What is understand-type-widening?

Use when confused why TypeScript infers general types. Use when const vs let gives different types. Use when literals become string or number. Source: marius-townhouse/effective-typescript-skills.

How do I install understand-type-widening?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill understand-type-widening Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Where is the source repository?

https://github.com/marius-townhouse/effective-typescript-skills