refactor: remove unused optional arguments and fields - #3195
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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 🙏🏼