कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

neo-es6-refactor

martinforsulu द्वारा

Web & Frontend Development
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Automatically refactor JavaScript/TypeScript code to use modern ES6+ patterns and features.

विवरण

यह स्किल क्या करती है

Automatically modernizes JavaScript and TypeScript codebases by converting legacy patterns to ES6+ equivalents. Handles var-to-let/const, callbacks-to-async/await, CommonJS-to-ES modules, and more. Preserves functionality, comments, and type annotations throughout.

AST-based transformation guarantees functional equivalence and catches edge cases that regex-based find-and-replace approaches miss.

इसे कब इस्तेमाल करें

  • Upgrading a legacy Node.js codebase to ES modules before a major release
  • Converting callback-heavy API client code to async/await
  • Batch-refactoring all .js files in a monorepo to use const/let and arrow functions
  • Migrating a TypeScript project from CommonJS require() to import statements
  • Previewing ES6+ changes with a dry-run diff before committing

उदाहरण वर्कफ़्लो

इनपुट

User asks: Convert this legacy JavaScript file to use modern ES6+ syntax

एजेंट
  1. 1

    Parse the input file into an AST using Babel parser

  2. 2

    Analyze variable reassignments to determine var-to-const vs var-to-let conversions

  3. 3

    Apply transformation rules: arrow functions, template literals, destructuring, async/await

  4. 4

    Format the output with Prettier-consistent indentation

  5. 5

    Return unified diff showing all changes alongside the transformed file

आउटपुट

Refactored file with var replaced by const/let, callbacks replaced by async/await, and CommonJS require() replaced by import statements

इंस्टॉलेशन

clawhub install martinforsulu/neo-es6-refactor

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक