typescript-conventions

Enforce strict TypeScript compiler options and typing patterns across Hybrid projects.

17|Updated Mar 14, 2023
One-click install
npx skills add https://github.com/hybrid-npm/hybrid --skill typescript-conventions-hybrid-npm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-conventions
Source: https://github.com/hybrid-npm/hybrid/tree/main/.agents/skills/typescript-conventions
Command: npx skills add https://github.com/hybrid-npm/hybrid --skill typescript-conventions-hybrid-npm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces TypeScript strict mode conventions to improve type safety and maintainability across Hybrid projects.

Core Features & Use Cases

  • Enforces strict compiler options like noUncheckedIndexedAccess, noImplicitReturns, noFallthroughCasesInSwitch, noImplicitOverride, exactOptionalPropertyTypes, and noPropertyAccessFromIndexSignature.
  • Demonstrates branded types, discriminated unions, type guards, and a zero-any policy to prevent unsafe typing.
  • Provides guidance for interface vs type usage, async patterns, null/undefined handling, and schema validation with Zod.

Quick Start

Enable strict TypeScript configuration across your packages and begin applying branded types, discriminated unions, and robust type guards.

Frequently Asked Questions about typescript-conventions

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

FAQPage Schema
How do I enforce strict TypeScript conventions for type safety?

Enforce strict TypeScript conventions by enabling compiler options like noUncheckedIndexedAccess, noImplicitReturns, and exactOptionalPropertyTypes to ensure type safety and predictable behavior across your packages.

What is the best way to use branded types and discriminated unions in TypeScript?

The best way to use branded types and discriminated unions in TypeScript is applying them alongside robust type guards to prevent unsafe typing and enforce a zero-any policy during code authoring and review.

How do I handle null and undefined safely in strict TypeScript mode?

Handle null and undefined safely in strict TypeScript mode by applying specific guidelines for async patterns and exactOptionalPropertyTypes, ensuring predictable behavior without relying on unsafe typing fallbacks.

Does this TypeScript style guide cover schema validation with Zod?

Yes, this TypeScript style guide covers schema validation with Zod, providing specific guidelines and examples to ensure type safety and runtime validation align across your project.

When should I use interfaces vs types in TypeScript?

Use interfaces vs types in TypeScript based on specific guidelines that dictate interface usage for object shapes and type aliases for unions, ensuring strict type safety and maintainable code structure.

What are the limitations of using strict TypeScript compiler options?

Limitations of using strict TypeScript compiler options include requiring explicit handling of null, undefined, and index signatures, which increases initial code authoring effort but prevents unsafe typing and unpredictable runtime behavior.