modernize_legacy_code
Convert legacy code snippets to modern production code: CommonJS to ESM, classes to hooks, var to const, callbacks to async/await, and JavaScript to TypeScript.
Instructions
Transforms legacy code snippets into modern production code (CommonJS require -> ESM imports, Class components -> React Hooks, var -> const/let, callbacks -> async/await, JavaScript -> TypeScript).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code_snippet | Yes | The legacy code snippet to modernize | |
| target_language | Yes | Target modernization stack |