no-explicit-any
यह क्या करती है
यह स्किल TypeScript फ़ाइलों में 'any' टाइप की जाँच करती है, जो टाइप चेकिंग को बंद कर देता है। यह उन डेवलपर्स के लिए है जो चाहते हैं कि उनका TypeScript ज़्यादा गलतियाँ जल्दी पकड़े।
कब इस्तेमाल करें
- ✓जब आप एजेंट से किसी TypeScript फ़ाइल की टाइप सुरक्षा समस्याएँ जाँचने को कहें।
- ✓जब आपका linter 'any' टाइप पर चेतावनियाँ दिखाए और आप उन्हें सही तरह ठीक करना चाहें।
- ✓जब कोई फ़ंक्शन ऐप के बाहर से आया डेटा संभाले और आप उसे इस्तेमाल से पहले जाँचना चाहें।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/no-explicit-any/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरी TypeScript फ़ाइलें देखकर 'any' टाइप को सुरक्षित टाइप से बदल सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट 'any' के हर इस्तेमाल को खोजता है, जिसमें अप्रत्यक्ष और assert किए गए मामले भी हैं। वह 'unknown', generics या validation जैसे विकल्प सुझाता है, और हर मान के इस्तेमाल पर ज़रूरी जाँच दिखाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
'any' और 'unknown' में क्या अंतर है?
'any' सारी जाँच पूरी तरह बंद कर देता है, जबकि 'unknown' के मान को इस्तेमाल से पहले टाइप जाँच की ज़रूरत होती है।
क्या टाइप assertion कभी ठीक है?
स्किल कहती है कि कुछ मामलों में यह ठीक हो सकता है, पर असली समस्या छिपाने के लिए इस्तेमाल हो तो यह खतरनाक है।
ऐप की सीमाओं पर बाहरी डेटा क्यों जाँचें?
स्किल सुझाती है कि बाहरी डेटा को Zod जैसी validation लाइब्रेरी से जाँचें, न कि उसका टाइप assert करें।
जानकारी
लेखक का मूल विवरण
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.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #2950
- लाइसेंस
- MIT
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।