Skip to content

[Fix]: replace TypeScript 'any' types with proper type definitions #4704

@Sam-61s

Description

@Sam-61s

Description

Replaced all problematic any types with proper TypeScript types to improve type safety, developer experience, and code maintainability across the codebase.

Files Changed

Created

  • components/roadmap/types.ts - Shared type definitions for roadmap components

Modified

  • 📝 components/helpers/applyFilter.ts - Removed any from type guards, added proper type checking
  • 📝 components/roadmap/RoadmapItem.tsx - Replaced local interface with shared type
  • 📝 components/roadmap/RoadmapColumn.tsx - Updated items prop type from any[] to RoadmapItem[]
  • 📝 components/roadmap/RoadmapList.tsx - Replaced inline type with shared RoadmapItem type
  • 📝 components/roadmap/RoadmapPill.tsx - Updated description to support React.ReactNode
  • 📝 components/navigation/Filter.tsx - Made component generic, improved internal type safety
  • 📝 components/CaseTOC.tsx - Added TocSection interface, replaced any[] in props
  • 📝 pages/roadmap.tsx - Updated RoadmapData interface to use RoadmapItem[]

Total: 1 file created, 8 files modified

Benefits

Type Safety - Catches errors at compile time
IntelliSense - Better IDE autocomplete and hints
Refactoring Safety - Changes show errors across all usages
Documentation - Types serve as inline documentation
Runtime Safety - Type guards prevent runtime errors

Testing

  • npx tsc --noEmit passes with 0 errors
  • ✅ No linter errors in any modified files
  • ✅ All existing functionality preserved
  • ✅ No breaking changes to component APIs

This PR eliminates technical debt and improves code quality without changing any functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions