typescript

Designs TypeScript types, fixes type errors, and configures typed package builds.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill typescript-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/typescript
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill typescript-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? TypeScript codebases accumulate unsound types, broken tsconfig settings after upgrades, and packages whose types fail for consumers. This Skill provides version-aware rules and workflows to model domains correctly, eliminate any and unsafe casts, fix TypeScript 6/7 configuration breakage, and verify packages before publishing. ## Core Features & Use Cases - Domain type modelling: Replace boolean flag soup with discriminated unions, branded identifiers, exhaustive never checks, and errors-as-data so illegal states fail to compile. - Configuration and upgrades: Fix tsconfig for TypeScript 6.0/7.0 removed options, changed defaults (types, rootDir, module), and choose module/moduleResolution by consumption model. - Type-safety hardening: Inventory and remove any, as casts, and non-null assertions using the narrowing ladder, type predicates, and assertion functions. - Package publishing: Write correct exports maps, emit declarations, and gate releases with publint and arethetypeswrong. - Use Case: After bumping the typescript devDependency, your build fails with removed-option errors and 'Cannot find name process' — the Skill identifies the 7.0 hard errors, rewrites the config explicitly, and explains each change. ## Quick Start Ask the assistant to review your tsconfig.json and package.json for TypeScript 7 compatibility and fix any removed options or missing types entries.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I fix tsconfig errors after upgrading to TypeScript 7?

TypeScript 7.0 turned 6.0 deprecations into hard errors. Remove baseUrl and fold prefixes into paths entries, replace moduleResolution node with nodenext or bundler, drop target es5 and downlevelIteration, and add explicit rootDir and types entries since defaults changed.

How do I model state in TypeScript without boolean flags?

Replace independent booleans with a discriminated union keyed on a literal status field, putting each optional field on the variant that owns it. Add a never assignment in the default branch of switches so adding a variant fails to compile.

Why do consumers get any types from my published npm package?

Consumers get any when no declaration file is reachable: declaration emit was off, the .d.ts landed outside the exports map, or files excluded it from the tarball. Verify with npm pack --dry-run, npx publint, and npx @arethetypeswrong/cli --pack . before publishing.

Should I use satisfies, an annotation, or as in TypeScript?

Use satisfies to check a literal against a contract while keeping its precise inferred type, an annotation when you deliberately want widening, and as only when an unchecked cast is unavoidable. An annotation where satisfies belongs loses the literal types.

Does this skill cover React or Next.js TypeScript code?

No. React, Next.js, JSX component design, hooks, and rendering are explicitly out of scope and belong to a separate react skill. This skill covers only the TypeScript language, its compiler configuration, and typed package publishing.

Why does my Vitest suite pass but type errors still ship?

Vitest and other transpile-only runners strip types without checking them, so type errors never fail the suite. Add a separate tsc --noEmit script and CI step, ensure tsconfig include covers test files, and use vitest --typecheck for expectTypeOf assertions.