Skip to content

refactor: remove unused optional arguments and fields - #3195

Draft
JonasBa wants to merge 1 commit into
npmx-dev:mainfrom
JonasBa:jonas/unused-props-cleanup
Draft

refactor: remove unused optional arguments and fields#3195
JonasBa wants to merge 1 commit into
npmx-dev:mainfrom
JonasBa:jonas/unused-props-cleanup

Conversation

@JonasBa

@JonasBa JonasBa commented Aug 21, 2026

Copy link
Copy Markdown

Hey folks, I'm working on an experimental CLI which uses the tsgo toolchain to find optional component and function signatures that are in practice never passed. This is essentially dead code elimination, and a complementary workflow to run alongside a tool like knip.

The changeset in this PR has been done using the script as the reporting tool, and an agent validator loop walking through each reported line one by one to first inspect the report, analyze the call sites, removing them, and later re-running ts. If done correctly, the code that has been removed should have been effectively dead.

The reporting script heavily relies on type quality and only reports on types whos members are statically enumerable.

I'm opening this PR in an effort to help you eliminate dead code, but also to gain feedback on the script and the detection mechanisms. There are always risks of false positive reports, and removal of code that is actually still required at runtime.

Some references of PRs opened to other repositories that have been merged or are still open:
Sentry (4k loc removed)
Sentry (followup 1k loc removed)
Tanstack
npmx (this PR)

Would love to hear your feedback 🙏🏼

Generated with an experimental CLI that checks every call site of a
function and flags optional arguments and object fields that are never
provided. Previous defaults are inlined so runtime behavior is
unchanged. Findings whose call sites live in Vue SFCs (invisible to the
scanner) were verified manually and kept.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview Aug 21, 2026 4:33pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Aug 21, 2026 4:33pm
npmx-lunaria Ignored Ignored Aug 21, 2026 4:33pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5e72192-46b1-4cc9-9c19-cb4b0e0a6f3a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/composables/npm/useAlgoliaSearch.ts 0.00% 1 Missing ⚠️
cli/src/npm-process.ts 0.00% 0 Missing and 1 partial ⚠️
server/api/auth/atproto.get.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant