Open
Conversation
- Proper types in utils, store, components - Type guards for table data - Enable ESLint any detection
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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
anywithunknownornever[]where type information is genuinely unavailable - Added proper type guards and interfaces for better type checking
- Fixed type assertions to use
as unknown as Tpattern 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
anydetection