any-type

Identify TypeScript any usage and guide replacement with unknown or generics.

3|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/ncaq/konoka --skill any-type
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: any-type
Source: https://github.com/ncaq/konoka/tree/main/plugins/web-tasuke/skills/any-type
Command: npx skills add https://github.com/ncaq/konoka --skill any-type

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Using any in TypeScript disables type checks and can lead to runtime errors; this Skill advocates replacing any with unknown, generics, or proper type definitions to preserve type-safety and maintainable code.

Core Features & Use Cases

  • Enforces avoidance of any in TypeScript code and guides replacement with unknown or generics.
  • Provides practical examples and ESLint guidance (e.g., no-explicit-any) to maintain consistency.
  • Use case: during code reviews to quickly identify unsafe any usage and propose safe alternatives.

Quick Start

Audit a TypeScript file to identify all uses of any and suggest safe replacements using unknown, generics, or proper type definitions.

Frequently Asked Questions about any-type

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

FAQPage Schema
How do I replace TypeScript any usage to restore type-safety?

Replace TypeScript any by applying unknown, generics, or proper type definitions to restore type-safety and prevent runtime errors. This process guides safe replacements to maintain code consistency.

Why does using any in TypeScript cause runtime errors?

Using any in TypeScript causes runtime errors because it disables type checks, completely bypassing static analysis. Replacing any with unknown preserves type checking by forcing explicit type narrowing before usage.

What is the best way to identify unsafe any usage during code reviews?

The best way to identify unsafe any usage during code reviews is to audit TypeScript files to locate all instances and propose safe alternatives using unknown or generics, ensuring consistent type-safety.

How do I set up ESLint to enforce avoiding any in TypeScript?

Set up ESLint to enforce avoiding any in TypeScript by applying linting guidance like the no-explicit-any rule. This ensures consistent use of unknown or proper types instead of any across files and modules.

When should I use unknown instead of any in TypeScript?

Use unknown instead of any in TypeScript when you cannot determine a variable's type at definition time. Unlike any, unknown forces type narrowing through checks before usage, preserving static analysis and type-safety.

Can I audit an entire TypeScript project to replace any with generics?

Yes, you can audit an entire TypeScript project to identify all uses of any and guide replacements with generics. This ensures modules maintain type-safety by enforcing proper type definitions instead of unchecked any.