🏠 Início
Avaliações
📊 Todos os Benchmarks 🦖 Dinossauro v1 🦖 Dinossauro v2 ✅ Aplicações To-Do List 🎨 Páginas Livres Criativas 🎯 FSACB - Showcase Definitivo 🌍 Benchmark de Tradução
Modelos
🏆 Top 10 Modelos 🆓 Modelos Gratuitos 📋 Todos os Modelos ⚙️ Kilo Code
Recursos
💬 Biblioteca de Prompts 📖 Glossário de IA 🔗 Links Úteis
advanced

Legacy Code Refactoring to TypeScript

#refactoring #typescript #architecture #solid-principles

Refactor a complex legacy module to modern TypeScript using SOLID principles.

Act as a Senior Software Architect. You are presented with a legacy module written in older JavaScript that suffers from tight coupling, global state reliance, and lack of error handling. Your task is to: 1. Rewrite the code using modern TypeScript features, specifically utilizing generics and utility types. 2. Refactor the structure to strictly adhere to SOLID principles, decoupling dependencies where necessary. 3. Implement robust error handling with custom error classes. 4. Add JSDoc comments for all public interfaces. 5. Provide a detailed diff-style explanation justifying the architectural choices made to improve maintainability and testability.