SKILL

typescript-patterns

适用于现代 TypeScript 和 JavaScript 应用的 TypeScript 模式,用于编写严格、类型安全、可维护的代码。涵盖严格编译器配置、类型设计、类型收窄、可辨识联合、泛型、异步与错误处理、模块边界、依赖卫生以及类型级测试。在编写或审查 TypeScript 或 JavaScript 代码时使用。

机器翻译
查看英文原文

TypeScript patterns for strict, type-safe, maintainable code in modern TypeScript and JavaScript applications. Covers strict compiler configuration, type design, narrowing, discriminated unions, generics, async and error handling, module boundaries, dependency hygiene, and type-level testing. Use when writing or reviewing TypeScript or JavaScript code.

适用对象:软件开发与测试。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • TypeScript Development Patterns
  • When to Activate
  • Core Principles
  • 1. Strict Mode Is the Baseline
  • 2. any Is a Bug, Not a Tool
  • 3. Public APIs Get Explicit Types, Locals Get Inference
  • Type Design
  • Interfaces vs. Type Aliases

TypeScript patterns and best practices for building robust, type-safe, and maintainable applications. The compiler is most useful when it can prove your program's shape, so the guiding principle here is: push the type system to do real work instead of fighting it. This skill is the "how." For the "what" and "when" (the decisions about which pattern to reach for), see the TypeScript rules — rules/typescript/coding-style.md and rules/typescript/patterns.md in this repository, installed as rules/ecc/typescript/coding-style.md and rules/ecc/typescript/patterns.md. Writing new TypeScript or JavaScript code Reviewing a PR that touches .ts or .tsx files Refactoring existing TypeScript to remove any, tighten types, or add strictness Designing types, generics, or module boundaries for a new feature Setting up a new TypeScript project or upgrading tsconfig.json Debugging type errors that cascade through a codebase (usually a design problem, not an annotation problem) strict: true (which enables strictNullChecks, noImplicitAny, strictFunctionTypes, and the rest) is not optional in a healthy codebase. If a codebase cannot compile under strict, that is a migration task, not an excuse to leave t

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
affaan-m/ECC
源文件
pi/core/skills/typescript-patterns/SKILL.md
固定版本
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
阅读完整原作者说明 ↗

准备条件

  • 本条仅收录原作者的技能元数据;请阅读完整说明,确认依赖、许可与使用条件。

第一件可以尝试的小事

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

对应 AI 工具说明

作者有说明不等于本站实机验证。没有证据时,不自动标为兼容、安全或免费。

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:43.305Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。