typescript

Enforce strict compile-time type safety in TypeScript source files.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/BrunoAMSilva/my-config --skill typescript-brunoamsilva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/BrunoAMSilva/my-config/tree/main/coding/skills/typescript
Command: npx skills add https://github.com/BrunoAMSilva/my-config --skill typescript-brunoamsilva

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reduce runtime errors and developer friction by ensuring compile-time correctness, consistent typing, and safer refactors across TypeScript codebases.

Core Features & Use Cases

  • Enforces strict compiler settings and recommended tsconfig patterns to catch issues early.
  • Provides patterns to avoid any, prefer unknown with type guards, constrain generics, use import type, and apply as const and satisfies for precise typing.
  • Includes guidance for configuring projects, library declaration files, error handling patterns, and practical examples for migrating JS to TS or improving large codebases.

Quick Start

Enable strict mode in tsconfig.json, replace any with unknown and appropriate type guards, and add import type usage where needed to resolve current type errors in your .ts and .tsx files.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce strict type safety in TypeScript source files?

To enforce strict type safety in TypeScript source files, enable strict mode in your tsconfig.json. This activates compilerOptions like no implicit any and strict null checks to catch issues at compile-time.

What's the best way to replace any in TypeScript to avoid runtime errors?

The best way to replace any in TypeScript to avoid runtime errors is using the unknown type combined with appropriate type guards. This ensures compile-time correctness while safely narrowing types during execution.

How do I configure tsconfig for library declaration files and genercs?

To configure tsconfig for library declaration files and generics, apply recommended compiler settings that constrain generics and enforce import type usage. This ensures strict typing and consistent interface design across your project.

Does this approach work for migrating JavaScript to TypeScript in large codebases?

Yes, this approach works for migrating JavaScript to TypeScript in large codebases by applying practical examples and error handling patterns. It reduces developer friction by ensuring safer refactors and compile-time correctness during migration.

When should I use utility types and satisfies for precise typing?

You should use utility types and the satisfies operator for precise typing when you need to enforce strict compiler rules without altering the inferred type structure. This applies as const and import type patterns for safer refactoring.

Why does TypeScript throw no-unused errors in my .tsx files?

TypeScript throws no-unused errors in your .tsx files because strict compilerOptions are enabled to enforce compile-time correctness. Resolve these type errors by removing unused variables or applying appropriate import type usage.