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 type safety problems. It helps the agent spot unsafe 'any' types in TypeScript code so it can flag weak spots, especially in functions that handle external data or where the codebase has ESLint warnings for @typescript-eslint/no-explicit-any.

Use Avoid the any type — use unknown, generics, or type guards instead in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Avoid the any type — use unknown, generics, or type guards instead and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

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

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have a TypeScript codebase to review.

Avoid the any type — use unknown, generics, or type guards insteadStart free

What your AI can do with it

  • Review TypeScript files for type safety regressions
  • Flag functions that handle external data during code review
  • Detect uses of the 'any' type that weaken type safety
  • Address ESLint warnings for @typescript-eslint/no-explicit-any

Getting started

  1. Have a TypeScript codebase to review.
  2. Add the no-explicit-any skill to your agent's available skills.
  3. Ask the agent to review TypeScript files for type safety regressions or functions handling external data.
  4. Review the flagged weak spots the agent reports.

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
Oct 2026

Questions

When should this skill be used?
Use it 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.
Does it replace ESLint?
No. It works alongside ESLint by helping the agent address warnings for the @typescript-eslint/no-explicit-any rule.
What does it flag?
It flags unsafe 'any' types in TypeScript code, pointing out weak spots where type safety is lost.
Advanced
Item type
skill
Key
no-explicit-any
Source
github.com/thedaviddias/front-end-checklist