my-ts-rules

强制执行严格的 TypeScript 规范,禁止使用 any,要求显式返回类型。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "my-ts-rules" with this command: npx skills add soberlevi/my-skills/soberlevi-my-skills-my-ts-rules

严格 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

codex-claude-loop

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

extracting-code-structure

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-changelog

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

analyzing-code-structure

No summary provided by upstream source.

Repository SourceNeeds Review