AGENT SKILL

typescript-standards

Use when writing or configuring TypeScript at the LANGUAGE level (any framework) — tsconfig, pnpm, Biome, module/import hygiene, Vitest config, type patterns — in a touchstone repo. Triggers on .ts/.tsx, tsconfig.json, package.json. For framework rules use the framework skill (react/next/nuxt).

License 许可
MIT
所属仓库
hwanngo/touchstone
最近更新
2026-08-26
Stars
★ 0
Forks
0

01 前言 Front Matter

name
typescript-standards
license
MIT
metadata
{ "author": "touchstone", "version": "0.2.0" }
description
Use when writing or configuring TypeScript at the LANGUAGE level (any framework) — tsconfig, pnpm, Biome, module/import hygiene, Vitest config, type patterns — in a touchstone repo. Triggers on .ts/.tsx, tsconfig.json, package.json. For framework rules use the framework skill (react/next/nuxt).

03 SKILL.md 正文

TypeScript (language)

Full standard: standards/languages/typescript.md. For framework specifics see frameworks/. Load-bearing rules:

Always

  • pnpm only (pin packageManager + Corepack); commit pnpm-lock.yaml; CI --frozen-lockfile; keep lifecycle-script blocking on; pnpm audit.
  • Biome for lint+format (no ESLint/Prettier); enable react/test domains + a11y; CI runs biome ci.
  • Strict tsconfig + noUncheckedIndexedAccess, verbatimModuleSyntax, isolatedModules, moduleDetection: force. tsc --noEmit green in CI.
  • No any — unknown + narrowing, generics, or a schema. import type for type-only.

Don't get burned

  • Absolute imports; ban barrel files (index.ts re-export hubs) — tree-shaking + cycle hazard.
  • Vitest with enforced coverage thresholds; mock the network (MSW), not fetch.
  • Monorepo: pnpm workspaces + workspace:* + shared base tsconfig/biome.json.

Done

biome ci · tsc --noEmit · vitest (coverage ≥ floor) all green. See standards/languages/typescript.md.

04 同仓库更多 Skills