Avoid the any type — use unknown, generics, or type guards instead

SkillFiles & storage

no-explicit-any is a skill for AI agents that reviews TypeScript code for uses of the any type. It scans files for explicit and implicit any, flags type safety regressions during code review, and suggests safer alternatives such as unknown, generics, or Zod validation. It is useful when a codebase has ESLint warnings for @typescript-eslint/no-explicit-any.

Available today. Use it from your connected AI after setup.

Have a TypeScript file or codebase to review, ideally with ESLint configured for @typescript-eslint/no-explicit-any.

Then ask your AI: use the Avoid the any type skill

What your AI can do with it

  • Scan a TypeScript file for explicit any annotations, implicit any, and assertions to any
  • Report each any location and suggest a safer alternative
  • Replace any with unknown, generics, or Zod validation and show the needed narrowing
  • Review function signatures and external data handling for type safety regressions
  • Explain how any undermines TypeScript's guarantees and when as Type is acceptable

Getting started

  1. Have a TypeScript file or codebase to review, ideally with ESLint configured for @typescript-eslint/no-explicit-any.
  2. Add the skill to your agent so it can be invoked during code review or refactoring tasks.
  3. Ask the agent to check a file for any types, fix them, explain the rule, or perform a code review.
  4. Consult references/rule.md for full implementation details, code examples, and framework-specific guidance.

What this skill tells your AI

The instructions your AI receives, as published by thedaviddias/front-end-checklist in skills/no-explicit-any/SKILL.md and read by ahel’s review.

The any type is a local opt-out that becomes a global problem: a function returning any propagates unchecked types to every caller, silently undermining the type system across the entire codebase. Replacing any with unknown forces type narrowing at the point of use, turning latent runtime errors into compile-time failures where they are cheapest to fix.

Quick Reference

  • any disables all type checking for a value and cascades to callers
  • unknown is the safe alternative — it requires a type check before use
  • Use generics to express "I accept any type, but it stays consistent"
  • At API boundaries, validate with Zod rather than asserting with as Type

Check

Scan this TypeScript file for uses of the any type (explicit annotations, implicit any from missing types, and type assertions to any). Report each location and suggest a safer alternative.

Fix

Replace the any types in this code with unknown (for values of unknown shape), appropriate generics (for type-consistent operations), or Zod validation (for external data). Show the narrowing or generic constraint needed at each usage site.

Explain

Explain why the any type undermines TypeScript's guarantees, how unknown differs from any, and when a type assertion (as Type) is acceptable versus dangerous.

Code Review

Review all type annotations, function signatures, and external data handling in this file. Flag every explicit or implicit any, any type assertion that lacks a preceding type guard, and any return types inferred as any from untyped dependencies.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/en/rules/javascript/no-explicit-any

Signals

GitHub stars
74k
Forks
7k
Last commit
Aug 2026

Questions

When should this skill be used?
When reviewing TypeScript files for type safety regressions, during code review of functions that handle external data, or when the codebase has ESLint warnings for @typescript-eslint/no-explicit-any.
Why is the any type a problem?
any disables all type checking for a value and cascades to callers, silently undermining the type system across the codebase. Replacing it with unknown forces type narrowing at the point of use, turning latent runtime errors into compile-time failures.
Advanced
Item type
skill
Key
no-explicit-any
Source
github.com/thedaviddias/front-end-checklist