migrate-to-shoehorn

Convert 'as' type assertions in TypeScript tests to Shoehorn.

1|Updated Aug 16, 2023
One-click install
npx skills add https://github.com/monlor/dotfiles --skill migrate-to-shoehorn-monlor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/monlor/dotfiles/tree/main/config/ai/agents/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/monlor/dotfiles --skill migrate-to-shoehorn-monlor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @total-typescript/shoehorn, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Converts 'as' type assertions in TypeScript tests to Shoehorn, improving type safety and reducing manual typing.

Core Features & Use Cases

  • Type Safety: Converts 'as' assertions to type-safe alternatives, preventing runtime errors.
  • Partial Data Handling: Allows passing partial data in tests without losing type safety.
  • Intentional Error Testing: Supports passing intentionally wrong data for error testing in tests.

Quick Start

Install Shoehorn, then run the migrate-to-shoehorn skill to convert 'as' assertions to Shoehorn in your test files.

Frequently Asked Questions about migrate-to-shoehorn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert 'as' type assertions to Shoehorn in TypeScript tests?

You can convert 'as' type assertions to Shoehorn by running the migrate-to-shoehorn skill, which automatically replaces assertions with type-safe alternatives to improve type safety in tests.

Why should I replace 'as' assertions with Shoehorn for type safety?

Replacing 'as' assertions with Shoehorn improves type safety and reduces manual typing by preventing runtime errors in tests, ensuring your TypeScript code adheres to stricter type checks.

Can I use Shoehorn to handle partial data in TypeScript test automation?

Yes, Shoehorn supports partial data handling in test automation, allowing you to pass partial data without losing type safety when migrating 'as' assertions.

Does migrate-to-shoehorn work with intentional error testing in TypeScript?

Yes, the tool supports intentional error testing by allowing you to pass intentionally wrong data in test scenarios while maintaining type safety through Shoehorn conversions.

Do I need to install @total-typescript/shoehorn before migrating type assertions?

Yes, you must install the @total-typescript/shoehorn dependency before running the migrate-to-shoehorn skill, as the tool requires this package to operate and convert assertions.

What is the best way to migrate 'as' assertions for better TypeScript type safety?

The best way to migrate 'as' assertions for better type safety is using an automated conversion skill like migrate-to-shoehorn, which replaces manual typing with safer Shoehorn alternatives.