Skip to content

chore: garbage-collect dead code (sdk/, 16 unused packages)#4

Merged
thisyearnofear merged 4 commits into
mainfrom
chore/lint-sweep
May 24, 2026
Merged

chore: garbage-collect dead code (sdk/, 16 unused packages)#4
thisyearnofear merged 4 commits into
mainfrom
chore/lint-sweep

Conversation

@thisyearnofear

@thisyearnofear thisyearnofear commented May 24, 2026

Copy link
Copy Markdown
Owner

Changes

  • Reverted the automated lint-sweep commit (broke 39+ files by removing JSX imports)
  • Removed sdk/ directory (orphaned project, 1214 lines)
  • Uninstalled 16 unused packages: wallet-adapter-ant-design, ethersproject/wallet, farcaster/hub-web, wallet-standard/core, aptos v1, got, hls.js, leva, lucide-react, pino-pretty, recharts, ws, testing-library/jest-dom, testing-library/user-event, web-vitals, types/three
  • Added @polymarket/builder-signing-sdk (was already imported, missing from package.json)
  • Cleaned up .eslintrc.json, .gitignore references to removed sdk/

Summary by CodeRabbit

Release Notes

  • Chores
    • Upgraded React and React DOM to v19 for improved features and performance.
    • Removed the internal SDK module and related exports from the package.
    • Updated development dependencies and ESLint configuration.
    • Simplified package structure by removing unused wallet adapter and utility packages.

Review Change Stack

Removed 296 of 341 warnings (87% reduction):
- Remove unused imports (React, components, named imports)
- Prefix unused variables with _
- Fix no-undef bugs: add missing vars in KalshiOrderPanel, TippingModal, signals/page
- Fix no-empty blocks with comments, no-extra-semi, no-case-declarations with braces
- Revert broken prefixing on 3 files (test-deep-reasoning, polymarketService, aiService.server)

Remaining 45 are JSX false positives in 3D components (Scene3D, ForecastPortals, weather3d/*)
and 3 intentionally kept dead-code variables (dead code, non-breaking).
- Update react/react-dom from ^18.3.1 to ^19
- Update @types/react and @types/react-dom from ^18 to ^19
- @react-three/drei v10 requires React 19 peer dep (was masked by legacy-peer-deps)
- All major deps (next, redux, wagmi, react-query, antd) support React 19
- .npmrc: keep legacy-peer-deps for eslint-config-next@16 requiring eslint>=9 (separate issue)
- Full CI: typecheck ✅, lint ✅ (45 warnings, same 45), tests ✅ (131/131)
@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
fourcast Error Error May 24, 2026 8:45am

@thisyearnofear thisyearnofear merged commit 769bc82 into main May 24, 2026
2 of 3 checks passed
@thisyearnofear thisyearnofear deleted the chore/lint-sweep branch May 24, 2026 08:45
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Remove orphaned SDK directory and clean up 16 unused packages

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Removed orphaned sdk/ directory (1214 lines, unused)
• Uninstalled 16 unused npm packages from dependencies
• Added missing @polymarket/builder-signing-sdk dependency
• Upgraded React from v18 to v19 with type definitions
• Updated ESLint configuration to remove sdk/ ignore pattern
• Added .npmrc comments clarifying legacy-peer-deps requirement
Diagram
flowchart LR
  A["Orphaned sdk/ directory"] -->|Remove| B["Deleted 1214 lines"]
  C["16 unused packages"] -->|Uninstall| D["Cleaned dependencies"]
  E["Missing dependency"] -->|Add| F["@polymarket/builder-signing-sdk"]
  G["React v18"] -->|Upgrade| H["React v19"]
  I["Config files"] -->|Update| J["ESLint & .npmrc"]
  B --> K["Cleaner codebase"]
  D --> K
  F --> K
  H --> K
  J --> K

Loading

File Changes

1. sdk/src/SignalPublisher.ts Deletion +0/-140

Removed entire SignalPublisher implementation file

sdk/src/SignalPublisher.ts


2. sdk/src/index.ts Deletion +0/-1

Removed SDK export barrel file

sdk/src/index.ts


3. sdk/README.md Deletion +0/-133

Removed SDK documentation and usage guide

sdk/README.md


View more (6)
4. sdk/SDK.md Deletion +0/-65

Removed SDK API reference documentation

sdk/SDK.md


5. sdk/package.json Deletion +0/-27

Removed SDK package configuration

sdk/package.json


6. sdk/tsconfig.json Deletion +0/-13

Removed SDK TypeScript configuration

sdk/tsconfig.json


7. package.json Dependencies +6/-21

Removed 16 unused packages, upgraded React, added missing SDK

package.json


8. .eslintrc.json ⚙️ Configuration changes +1/-1

Removed sdk/ from ESLint ignore patterns

.eslintrc.json


9. .npmrc 📝 Documentation +2/-0

Added comments explaining legacy-peer-deps requirement

.npmrc


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 24, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0)

Grey Divider


Action required

1. Missing recharts dependency 🐞 Bug ≡ Correctness
Description
components/PersonalStatsDashboard.js imports "recharts" but package.json no longer includes it, so
builds will fail with "Cannot find module 'recharts'". This dashboard is imported by
app/components/signals/MySignalsTab.js, so the missing dependency is on an active runtime path.
Code

package.json[61]

Evidence
The PR removes the recharts dependency, but the current code still imports it inside a component
that is imported and rendered by the app, guaranteeing a module-resolution failure during build.

components/PersonalStatsDashboard.js[1-6]
app/components/signals/MySignalsTab.js[1-4]
package.json[26-58]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`recharts` was removed from `package.json`, but the app still imports and renders `PersonalStatsDashboard`, which depends on `recharts`. This will break the Next.js build/bundle step due to unresolved module import.

### Issue Context
- `PersonalStatsDashboard` directly imports multiple exports from `recharts`.
- `MySignalsTab` imports and renders `PersonalStatsDashboard`, so this is not dead code.

### Fix Focus Areas
- package.json[26-58]
- components/PersonalStatsDashboard.js[1-6]
- app/components/signals/MySignalsTab.js[1-4]

### Expected fix
Either:
1) Add `recharts` back to `dependencies` (preferred if the dashboard is intended), or
2) Remove/replace the `PersonalStatsDashboard` feature and delete the `recharts` import(s).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. ESLint version mismatch 🐞 Bug ☼ Reliability
Description
.npmrc enables legacy-peer-deps while eslint-config-next requires ESLint >=9 but the repo pins
ESLint ^8, which can produce inconsistent/broken lint behavior despite installs succeeding. This
change turns a hard dependency conflict into silent technical debt that can fail later during
linting or upgrades.
Code

.npmrc[R1-3]

Evidence
.npmrc explicitly enables legacy peer deps, while package-lock shows eslint-config-next requires
ESLint >=9 and package.json still depends on ESLint ^8—this is a concrete version conflict being
suppressed rather than resolved.

.npmrc[1-3]
package-lock.json[12341-12361]
package.json[59-72]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The repo is forcing `legacy-peer-deps=true` to bypass a real peer dependency constraint: `eslint-config-next` declares `eslint >=9.0.0`, while this project uses `eslint ^8`. This may allow installs but leaves the lint toolchain in an unsupported state.

### Issue Context
`legacy-peer-deps` suppresses peer dependency resolution errors; it does not make incompatible tool versions actually compatible.

### Fix Focus Areas
- .npmrc[1-3]
- package.json[59-72]
- package-lock.json[12341-12361]

### Expected fix
Pick one path:
- Upgrade ESLint to a version satisfying `eslint-config-next` peer deps (and then remove `legacy-peer-deps`), or
- Pin/downgrade `eslint-config-next` to a version that supports ESLint 8 (and then remove `legacy-peer-deps`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Orphaned SDK references 🐞 Bug ⚙ Maintainability
Description
The sdk/ directory is deleted, but scripts and docs still reference it, so running
scripts/test-sdk-usage.cjs or following the documented project structure will fail/mislead. This
leaves broken tooling/documentation paths after the cleanup.
Code

sdk/src/index.ts[1]

Evidence
The script and documentation explicitly reference sdk/, but this PR removes the SDK code, leaving
those references dangling and causing failures/confusion when used.

scripts/test-sdk-usage.cjs[1-4]
README.md[110-120]
docs/NINE_PLAN.md[192-195]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The PR deletes `sdk/`, but at least one script and multiple docs still reference it, creating broken developer workflows and stale documentation.

### Issue Context
- `scripts/test-sdk-usage.cjs` requires `../sdk/dist/index.js` (no longer present).
- Root README and docs still describe `sdk/` as part of the repo.

### Fix Focus Areas
- scripts/test-sdk-usage.cjs[1-4]
- README.md[110-120]
- docs/NINE_PLAN.md[192-195]

### Expected fix
Either:
- Remove `scripts/test-sdk-usage.cjs` and update docs/README to no longer mention `sdk/`, or
- Reintroduce an SDK package (if still intended) and restore/update the script/docs accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bacb08ac-cef1-4a7b-a1f2-78c2c3c3b057

📥 Commits

Reviewing files that changed from the base of the PR and between 0b60c1b and d8dc456.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • sdk/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • .eslintrc.json
  • .gitignore
  • .npmrc
  • package.json
  • sdk/README.md
  • sdk/SDK.md
  • sdk/package.json
  • sdk/src/SignalPublisher.ts
  • sdk/src/index.ts
  • sdk/tsconfig.json

📝 Walkthrough

Walkthrough

The PR removes the Aptos-based SDK subsystem from the project, updates linting and build configuration to reflect its absence, and modernizes the dependency tree by upgrading React to version 19, removing wallet-related packages, and introducing the Polymarket builder signing SDK.

Changes

SDK Deprecation and React 19 Migration

Layer / File(s) Summary
Configuration cleanup for SDK deprecation
.eslintrc.json, .gitignore
ESLint no longer ignores the sdk/ directory. The .gitignore rule for sdk/dist is removed, reflecting that the SDK is no longer part of the project.
Dependency modernization
package.json
React and React-DOM upgraded from ^18.3.1 to ^19. Removed Aptos SDK (@aptos-labs/ts-sdk), wallet-related packages (@wallet-standard/core, @wallet-adapter-ant-design), and other utilities. Added @polymarket/builder-signing-sdk. Removed test utilities (@testing-library/jest-dom, @testing-library/user-event) and upgraded React type definitions to ^19.
NPM configuration documentation
.npmrc
Added comments explaining that legacy-peer-deps is enabled for eslint-config-next@16 ESLint 9 compatibility and documenting when it can be removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • thisyearnofear/fourcast#3: Related by SDK deprecation context, involving changes to sdk/dist ignore patterns in the same repository.

Poem

🐰 The signal SDK fades to dust,
React rises to nineteen we trust,
Polymarket's builder takes the reins,
Config cleaned of SDK's remains,
Onward hops our codebase bright! 🚀

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lint-sweep

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread package.json
"postprocessing": "^6.37.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"recharts": "3.8.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Missing recharts dependency 🐞 Bug ≡ Correctness

components/PersonalStatsDashboard.js imports "recharts" but package.json no longer includes it, so
builds will fail with "Cannot find module 'recharts'". This dashboard is imported by
app/components/signals/MySignalsTab.js, so the missing dependency is on an active runtime path.
Agent Prompt
### Issue description
`recharts` was removed from `package.json`, but the app still imports and renders `PersonalStatsDashboard`, which depends on `recharts`. This will break the Next.js build/bundle step due to unresolved module import.

### Issue Context
- `PersonalStatsDashboard` directly imports multiple exports from `recharts`.
- `MySignalsTab` imports and renders `PersonalStatsDashboard`, so this is not dead code.

### Fix Focus Areas
- package.json[26-58]
- components/PersonalStatsDashboard.js[1-6]
- app/components/signals/MySignalsTab.js[1-4]

### Expected fix
Either:
1) Add `recharts` back to `dependencies` (preferred if the dashboard is intended), or
2) Remove/replace the `PersonalStatsDashboard` feature and delete the `recharts` import(s).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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