es-modules
यह क्या करती है
यह स्किल पुराने module सिंटैक्स वाली JavaScript फ़ाइलों की समीक्षा करती है और आधुनिक मानक सुझाती है। यह उन डेवलपर्स के लिए है जो हल्का और साफ़ कोड चाहते हैं।
कब इस्तेमाल करें
- ✓जब आपकी JavaScript फ़ाइलें अब भी require() या module.exports इस्तेमाल करती हैं।
- ✓जब आपके bundle में ऐसा कोड है जो आप कभी इस्तेमाल नहीं करते।
- ✓जब आप चाहते हैं कि आपकी स्क्रिप्ट्स नेटिव browser modules के रूप में लोड हों।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/es-modules/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरी JavaScript फ़ाइल के require statements को import सिंटैक्स में बदल सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट require और module.exports वाली लाइनें खोजता है और मेल खाते import और export statements सुझाता है। जहाँ उपयुक्त हो, वहाँ named exports की सिफ़ारिश भी करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Use ES modules (import/export)
ES modules are statically analyzable — bundlers can determine at build time what code is actually used and eliminate the rest (tree-shaking). CommonJS require() is dynamic and prevents this optimization. ES modules are also the browser-native standard, reducing the need for build-time transformation.
Quick Reference
- Use import/export syntax instead of require()/module.exports
- Named exports improve IDE autocompletion and enable tree-shaking
- Add type="module" to script tags or use a bundler to load ES modules in browsers
- Default exports are fine but named exports scale better in large codebases
Check
Identify any use of require(), module.exports, or exports in this JavaScript file that should be converted to ES module syntax.
Fix
Convert all require() and module.exports statements to ES module import/export syntax.
Explain
Explain the benefits of ES modules over CommonJS, including tree-shaking, static analysis, and browser support.
Code Review
Review scripts, client components, and browser execution paths related to Use ES modules (import/export). Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/es-modules
अक्सर पूछे जाने वाले सवाल
tree-shaking क्या है?
यह तब होता है जब bundler ऐसा कोड हटा देता है जो कभी इस्तेमाल नहीं होता, जिससे फ़ाइलें छोटी होती हैं। आधुनिक module सिंटैक्स इसे संभव बनाता है।
क्या मुझे named exports इस्तेमाल करने चाहिए?
स्किल कहती है कि बड़े codebases में named exports बेहतर बढ़ते हैं, हालाँकि default exports भी ठीक हैं।
browser में modules कैसे लोड करें?
स्किल script टैग में type=module जोड़ने, या bundler इस्तेमाल करने का सुझाव देती है।
जानकारी
लेखक का मूल विवरण
Use when reviewing scripts, client components, bundles, or runtime behavior related to Use ES modules (import/export). Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #2836
- लाइसेंस
- 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
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।