my-ts-rules

SKILL.md

严格 TypeScript 技能指令

当你(AI)在编写或重构 TypeScript 代码时,必须遵守以下规则:

  1. 禁止使用 any: 即使是复杂的类型也必须定义 interface 或 type。
  2. 显式返回类型: 所有的函数(包括箭头函数)必须显式标注返回类型。
  3. 优先使用 Unknown: 在处理不确定类型时,使用 unknown 而不是 any

示例

const add = (a, b) => a + bconst add = (a: number, b: number): number => a + b

Weekly Installs
3
First Seen
Mar 2, 2026
Installed on
opencode3
gemini-cli3
claude-code3
github-copilot3
codex3
kimi-cli3