Remove unused optional props and arguments - #7997
Closed
JonasBa wants to merge 1 commit into
Closed
Conversation
Generated with an experimental CLI that inspects every call site of a function or component and flags optional props and arguments that are never provided. Each finding was manually verified against call sites; previous defaults are inlined so runtime behavior is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Hi, thanks for your interest. This is potentially a good idea, but we're not open to taking this type of PR currently. |
Author
|
@ayumi-signal appreciate the fast review. Let me know if this is something you'd be interested in at some point. |
This was referenced Aug 21, 2026
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.
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.
Deliberately left out of this PR:
ts/sql/(the DataReader/DataWriter IPC dispatch hides call sites from static analysis)onProgress/maxRetriesplumbing intusProtocolsince it forms a coherent capabilityI'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
Would love to hear your feedback 🙏🏼
Made with Cursor