🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích
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.