typescript-typecheck

Configures a standalone tsc type-check gate with strict tsconfig, project references, and CI enforcement.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill typescript-typecheck-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-typecheck
Source: https://github.com/bm629/agent-skills/tree/main/skills/typescript-typecheck
Command: npx skills add https://github.com/bm629/agent-skills --skill typescript-typecheck-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Bundlers and transpilers like Vite, esbuild, and SWC strip TypeScript types without checking them, so a build can pass while the code is full of type errors. This Skill sets up the missing piece: a dedicated tsc --noEmit type-check gate that runs locally and in CI, backed by a genuinely strict tsconfig. ## Core Features & Use Cases - Strict tsconfig authoring: Goes beyond strict: true with high-value flags like noUncheckedIndexedAccess, noImplicitOverride, and verbatimModuleSyntax, or extends @tsconfig/strictest as a base. - Vite split-config setup: Implements the three-file layout (solution tsconfig plus app and node leaf configs) with tsc -b && vite build and a standalone typecheck script. - Monorepo project references: Configures composite projects and tsc -b build mode so cross-package types resolve against emitted declarations. - CI gate: Adds a GitHub Actions step that fails the build on type errors the bundler would ignore. - Use Case: You scaffold a Vite React app in a pnpm monorepo and need CI to catch type errors across your app and a generated API client package before merge. ## Quick Start Set up a strict TypeScript type-check gate with a standalone typecheck script and CI step for my Vite React project.

Frequently Asked Questions about typescript-typecheck

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

FAQPage Schema
How do I add a TypeScript type-check step to CI?

Add a `typecheck` script running `tsc --noEmit` (or `tsc -b --noEmit` with project references) to package.json, then run it as a distinct step in your CI workflow. Keep it separate from the build step, since bundlers like Vite do not check types.

Does vite build check TypeScript types?

No. Vite only transpiles TypeScript via esbuild or SWC, which strip type annotations without checking them. You must run `tsc --noEmit` separately as a dedicated type-check gate locally and in CI.

What strict tsconfig flags should I enable beyond strict true?

Add `noUncheckedIndexedAccess`, `noImplicitOverride`, `noFallthroughCasesInSwitch`, `noImplicitReturns`, `noUnusedLocals`, `noUnusedParameters`, and optionally `exactOptionalPropertyTypes` and `verbatimModuleSyntax`. Alternatively, extend the `@tsconfig/strictest` base config.

How do TypeScript project references work in a monorepo?

Set `composite: true` on the referenced package, which forces declaration emit, then add a `references` entry on the consumer. Build with `tsc -b`, which builds dependencies in order and resolves cross-package imports against emitted .d.ts files.

Can I use tsgo or the native TypeScript compiler as my CI gate?

Not yet. The Go-based native compiler (`@typescript/native-preview`, `tsgo` command) is an explicit work-in-progress preview without full feature parity. Keep the standard `tsc` compiler as your authoritative CI type-check gate.

Why does moduleResolution bundler fail with module commonjs?

`moduleResolution: "bundler"` requires `module` to be `esnext` or `preserve`; `commonjs` is rejected. For Node libraries use `nodenext` for both settings instead of the bundler resolution mode.