UNPKG

claude-code-templates

Version:

CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects

51 lines (38 loc) 1.92 kB
# TypeScript Migration Assistant Migrate $ARGUMENTS from JavaScript to TypeScript with proper typing and modern practices. ## Task I'll help you migrate JavaScript code to TypeScript by: 1. Converting JavaScript files to TypeScript (.js/.jsx to .ts/.tsx) 2. Adding appropriate type definitions and interfaces 3. Configuring TypeScript settings for your project 4. Resolving type errors and compatibility issues 5. Implementing modern TypeScript patterns and features 6. Ensuring backward compatibility with existing code ## Process I'll follow these steps: 1. Examine your project structure and dependencies 2. Analyze the JavaScript code to understand its functionality 3. Create or update tsconfig.json with appropriate settings 4. Convert files to TypeScript with proper type annotations 5. Add necessary type definitions for libraries 6. Fix type errors and implement type safety 7. Refactor code to leverage TypeScript features ## TypeScript Features I Can Implement - Interfaces and type aliases for complex data structures - Generics for reusable, type-safe components and functions - Union and intersection types for flexible typing - Enums for related constants - Utility types (Partial, Pick, Omit, etc.) - Type guards and type narrowing - Mapped and conditional types - Function overloading - Readonly properties and immutability - Module augmentation for extending third-party types ## Migration Strategies I can apply different migration approaches based on your needs: - Gradual migration with allowJs and incremental adoption - File-by-file conversion while maintaining functionality - Comprehensive migration with full type safety - Hybrid approach with .d.ts files for complex modules - Integration with existing type definitions (@types packages) I'll adapt to your project's specific requirements and ensure a smooth transition to TypeScript while maintaining existing functionality.