no-explicit-any
What it does
This skill reviews TypeScript files for the 'any' type, which turns off type checking. It is for developers who want their TypeScript to catch more mistakes early.
When to use it
- ✓When you ask the agent to review a TypeScript file for type safety problems.
- ✓When your linter shows warnings about the 'any' type and you want them fixed properly.
- ✓When a function handles data from outside your app and you want that data checked before use.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/no-explicit-any/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you go through my TypeScript files and replace the 'any' types with safer ones?”
5 new skills a week. 1 minute to read.
How it works
The agent finds every place where 'any' is used, including implicit and asserted cases. It suggests replacements such as 'unknown', generics, or validation, and shows the checks needed where each value is used.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Avoid the any type — use unknown, generics, or type guards instead
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/rules/javascript/no-explicit-any
FAQ
What is the difference between 'any' and 'unknown'?
'any' turns off checks completely, while 'unknown' requires a type check before the value can be used.
Is it ever fine to use a type assertion?
The skill says an assertion can be acceptable in some cases, but it can be dangerous when used to hide real problems.
Why validate data at the edges of the app?
The skill recommends checking external data with a validation library such as Zod instead of asserting its type.
Details
Original description by the author
Use 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.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2950
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.