typescript-strict

Configures TypeScript strict mode with tsconfig flags, module resolution, and migration guidance.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/pohlai88/afenda-xforge-v5 --skill typescript-strict-pohlai88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-strict
Source: https://github.com/pohlai88/afenda-xforge-v5/tree/main/.agents/skills/typescript-strict
Command: npx skills add https://github.com/pohlai88/afenda-xforge-v5 --skill typescript-strict-pohlai88

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up TypeScript with maximum type safety is confusing: dozens of compiler flags, two module resolution strategies, and deprecated options make it easy to ship a misconfigured tsconfig.json. This Skill provides opinionated, modern TypeScript 5.x strict-mode configuration and migration guidance so projects catch more bugs at compile time. ## Core Features & Use Cases - Ready-to-use tsconfig templates: Production-grade configurations for both Vite/Bun (Bundler resolution) and Node.js (NodeNext resolution) projects with all recommended strict flags enabled. - Strict flag explanations: Detailed examples for noUncheckedIndexedAccess, noImplicitOverride, exactOptionalPropertyTypes, verbatimModuleSyntax, and every flag under the strict umbrella. - Incremental migration path: A four-step strategy to enable strict mode gradually in existing codebases without being overwhelmed by errors. - Use Case: You are starting a new Vite + React project and want maximum type safety. Use this Skill to generate a strict tsconfig.json with Bundler module resolution, path aliases, and verbatimModuleSyntax, then verify it with tsc --noEmit. ## Quick Start Ask the AI to generate a strict TypeScript tsconfig.json for your Vite or Node.js project and explain which strict flags to enable first.

Frequently Asked Questions about typescript-strict

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

FAQPage Schema
How do I enable TypeScript strict mode in tsconfig.json?

Set "strict": true in compilerOptions to enable all strict type-checking flags at once, including noImplicitAny, strictNullChecks, and strictFunctionTypes. For 2025 best practices, also add noUncheckedIndexedAccess, noImplicitOverride, and noPropertyAccessFromIndexSignature.

What is the difference between Bundler and NodeNext moduleResolution?

Bundler resolution is for Vite, Webpack, and Bun projects and requires no file extensions in imports. NodeNext is for Node.js libraries and servers, respects package.json type field, and requires explicit .js extensions even when importing .ts files.

How do I migrate an existing TypeScript project to strict mode?

Enable flags gradually: start with noImplicitAny and strictFunctionTypes while keeping strictNullChecks off, fix errors file by file using tsc --noEmit, then enable the full strict umbrella. Use @ts-expect-error comments for temporary suppressions during the transition.

What does noUncheckedIndexedAccess do in TypeScript?

noUncheckedIndexedAccess makes index signature and array access return T | undefined instead of T, forcing you to check for undefined before using the value. This prevents runtime errors when accessing keys or indices that do not exist.

Should I use verbatimModuleSyntax in my TypeScript project?

Yes, verbatimModuleSyntax is recommended for TypeScript 5.x because it prevents the compiler from rewriting imports and forces type-only imports to use import type syntax. It replaces the deprecated importsNotUsedAsValues and preserveValueImports options.

Why does TypeScript require .js extensions when importing .ts files?

This happens with moduleResolution set to NodeNext, which follows Node.js ESM behavior where import specifiers must match the emitted output files. Either add the .js extension to relative imports or switch to Bundler resolution if you use Vite or Bun.