-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Context & Impact
Multiple files use TypeScript any type, bypassing the type system entirely. Examples include CheckCircle2(props: any) in the offramp page, setTypeFilter(v as any) in the history page, error: any in the wallet provider, and data?: any in several components. Each any is a potential runtime crash that TypeScript can no longer catch at compile time.
Why this matters: TypeScript's entire value is catching bugs at compile time. Every any is a hole in that safety net. In a financial application where incorrect types could mean sending tokens to the wrong address or displaying wrong amounts, type safety is not optional — it's critical infrastructure.
Scope
- Audit all
anytype usage inapps/web/src/ - Replace each
anywith the correct specific type - Fix type errors that surface after replacing
any(these are real bugs being hidden) - Enable stricter TypeScript settings to prevent future
anyusage - Add
@typescript-eslint/no-explicit-anyESLint rule
Implementation Guidelines
- Search for
: any,as any, and<any>across the codebase - For
error: anyin catch blocks, useunknownand narrow with type guards - For component props, define proper interfaces
- For API responses, define response types matching the actual data shape
- For
as anycasts, determine the correct type and fix the underlying type mismatch - Do not replace
anywithunknowneverywhere — find the real type
Acceptance Criteria
- Zero
anytype annotations remain inapps/web/src/(excluding auto-generated files) - All
as anycasts are replaced with properly typed code - Catch blocks use
unknownwith proper type narrowing - All component props have defined interfaces
-
@typescript-eslint/no-explicit-anyrule is added to ESLint config aserror -
pnpm buildpasses with no type errors - No new runtime errors are introduced by the type fixes
Getting Started
- Run
grep -rn "any" apps/web/src/ --include="*.ts" --include="*.tsx" | grep -v node_modules | grep -v testto find all instances - Start with
src/providers/StellarWalletProvider.tsx— replaceerror: anywithunknown - Fix
src/app/(overview)/offramp/page.tsx— type theCheckCircle2props properly - Fix
src/app/(overview)/history/page.tsx— removeas anycast onsetTypeFilter - Work through remaining files systematically
- Add
@typescript-eslint/no-explicit-anytoeslint.config.mjs - Run
pnpm buildafter each file to catch issues early
PR Submission Guide
This section applies to every PR for this issue. Follow it exactly.
Before You Start
- Pull the latest
mainbranch:git checkout main && git pull origin main - Create your feature branch from
main:git checkout -b fix/<issue-number>-remove-any-types
While Working
- Make atomic commits — one concern per commit, each commit must build
- Use Conventional Commits:
feat(scope): description,fix(scope): description - Keep your branch up to date:
git pull origin main --rebaseregularly
Before Submitting the PR
- Pull latest
mainand rebase:git checkout main && git pull origin main && git checkout <your-branch> && git rebase main - Ensure the build passes:
pnpm build - Ensure linting passes:
pnpm lint - Record a screen recording of your implementation showing the feature/fix working in the browser. Attach it to the PR.
PR Requirements
- Link this issue in your PR description using
Closes #<issue-number> - Fill out the full PR template — Summary, What Was Implemented, Implementation Details, How to Test
- Attach your screen recording demonstrating the implementation
- Request a review from a maintainer
PRs without a screen recording or without a linked issue will not be reviewed. Failure to meet PR requirements may lead to PR rejection.