migrate-to-shoehorn

Installation
SKILL.md

Migrate to Shoehorn

Why shoehorn?

shoehorn 允许你在 tests 中传入 partial data,同时保持 TypeScript 满意。它用 type-safe alternatives 替换 as assertions。

只用于 test code。 永远不要在 production code 中使用 shoehorn。

Tests 中 as 的问题:

  • 经过训练,不去使用它
  • 必须手动指定 target type
  • 对故意错误的数据需要 double-as(as unknown as Type

Install

npm i @total-typescript/shoehorn
Installs
4.1K
GitHub Stars
3.6K
First Seen
May 6, 2026
migrate-to-shoehorn — vinvcn/mattpocock-skills-zh-cn