Pular para o conteúdo
Kitbay
Skill

migrate-to-shoehorn

MITAtualizado em 19 de nov. de 2026328.236Estrelas no GitHub

A skill from Matt Pocock's collection that moves TypeScript test files away from `as` type assertions and onto his @total-typescript/shoehorn library, and only in tests, never production code.

O que a skill ensina

A skill from Matt Pocock's collection that moves TypeScript test files away from `as` type assertions and onto his @total-typescript/shoehorn library, and only in tests, never production code. The agent first asks which test files cause trouble, whether large objects or deliberately wrong data are involved, then installs the package, searches .test.ts and .spec.ts files for assertions, and swaps them for fromPartial() when only some properties matter or fromAny() where a double assertion passed invalid data on purpose, adding the import. A table also explains fromExact() for full objects. It finishes with a type check.

O que faz

  • Find type assertions in test files
  • Replace assertions with fromPartial or fromAny
  • Add the shoehorn import and type-check