Skip to content

Conversation

@linkielink
Copy link
Member

  • Proper types in utils, store, components
  • Type guards for table data
  • Enable ESLint any detection

- Proper types in utils, store, components
- Type guards for table data
- Enable ESLint any detection
@vercel
Copy link

vercel bot commented Oct 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
mars-rd-fe Ready Ready Preview Oct 29, 2025 2:51pm

@linkielink linkielink requested a review from Copilot October 29, 2025 14:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves TypeScript type safety by replacing any types with more specific and appropriate types throughout the codebase. The changes enable the @typescript-eslint/no-explicit-any rule to be set to "warn" in the ESLint configuration.

  • Replaced any with unknown or never[] where type information is genuinely unavailable
  • Added proper type guards and interfaces for better type checking
  • Fixed type assertions to use as unknown as T pattern for necessary coercions
  • Added explicit return types to store slice creator functions

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/resolvers.ts Changed type assertions from as any to as unknown as string for position data conversions
src/utils/middleware.ts Changed SWR middleware parameter type from any[] to unknown[]
src/utils/helpers.ts Changed generic constraint from any[] to never[] for throttle function parameters
src/utils/array.ts Added interfaces (HasDenom, HasSymbol, HasToken) to replace any parameter types
src/types/classes/BNCoin.ts Added explicit return type to toSignedCoin() method
src/types/app.d.ts Added type annotations to interface properties (accounts, creditAccounts, hlsAccounts, resetStettingsModal, nullable icon)
src/store/slices/modal.ts Added explicit ModalSlice return type to slice creator
src/store/slices/common.ts Added explicit CommonSlice return type to slice creator
src/store/index.ts Added explicit Store return type to store creator
src/hooks/tokenomics/useOverviewChartData.ts Changed parameter type from any to OverviewData | null | undefined
src/hooks/charts/useChartDataTransform.ts Extended union type to include OverviewData | null | undefined
src/components/common/Table/Row.tsx Added type guards and replaced any casts with proper type checking
src/components/common/Chart/common/Legend/ChartLegend.tsx Changed index signature and array element type from any to unknown and Record<string, unknown>[]
src/components/common/Chart/PieChart/PieChartBody.tsx Replaced any with PieLabelRenderProps and added type guards for numeric properties
src/app/api/og/perps/[market]/route.tsx Added proper parameter typing and replaced any error handling with type-safe approach
src/api/assets/getDexAssets.ts Changed variable type from any[] to AstroportAsset[]
eslint.config.mjs Enabled @typescript-eslint/no-explicit-any rule as "warn"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants