Repository navigation
Remove dead declarations inside live files, barrel-only re-exports and unused default exports - #1171
Merged
Merged
Conversation
…d unused default exports Fifth chunk of the dead-code plan: the exports knip reports as imported nowhere, limited to declarations that are not used in their own file either (symbols that are only used in-file keep their export; that pass is optional and left out). - 77 declarations deleted outright: the nine unused bounty helpers, BountyHubSelector (its Hub type moves next to useBounties, its only reader), the four BaseFeedItem sections, LabelBadge, the two collapsible wrappers, useNote/useMakeNotePrivate/useUpdateNotePermissions, useUpdateOrgDetails/useUpdateOrgCoverImage, createFeedEntryFromWork, transformHub/transformContent, getAuditContentPreview and the text helpers only it called, the formatCombinedBalance pair, isValidPassword/isValidName, toNumberOrNull, isPinchGesture, ALL_CONTENT_TYPES, the deprecated HotScoreTooltip alias, the grant template object only getInitialContent returned, and the one-line Transformed* / response type aliases nothing references. - 43 barrel re-export lines dropped (Activity, Embed, Editor extensions, Table, WorkHeader, PublishingForm, AuthorPosts, BaseFeedItem and a few single type re-exports); everything behind them is still imported directly except TopicAndJournalBadge, FUNDING_KIND_LABEL and the FundingRequest interface, which had no other reader and go too. - 38 trailing `export default X;` lines removed from files that also export X by name; nothing imported the default. - @tiptap/extension-bullet-list, -ordered-list and -paragraph leave package.json: the barrel re-export was their only reference and StarterKit already provides those nodes. - Imports and local types orphaned by the deletions are removed; pre-existing unused imports in untouched lines are left alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This branch was successfully deployed
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.



Fifth chunk of the dead-code removal plan (
docs/dead-code-report.md, kept local), following #1169. This one works inside live files: the exports knip reports as imported nowhere, limited to declarations that are not used in their own file either. Symbols that are only used in-file keep theirexport(that mechanical pass is optional and left out).What goes
bountyUtil.ts;BountyHubSelector(itsHubtype moves next touseBounties, its only reader); the four unusedBaseFeedItemsections;LabelBadge; the two collapsible wrappers;useNote,useMakeNotePrivate,useUpdateNotePermissions;useUpdateOrgDetails,useUpdateOrgCoverImage;createFeedEntryFromWork;transformHub,transformContent;getAuditContentPreviewand the text helpers only it called; theformatCombinedBalancepair;isValidPassword/isValidName;toNumberOrNull;isPinchGesture;ALL_CONTENT_TYPES; the deprecatedHotScoreTooltipalias; the grant template object onlygetInitialContentreturned; and the one-lineTransformed*/ response type aliases nothing references.Activity,Embed,Editor/extensions,ui/Table,WorkHeader,PublishingForm,AuthorPosts,BaseFeedItem, plus a few single type re-exports). Everything behind them is still imported directly, exceptTopicAndJournalBadge,FUNDING_KIND_LABELand theFundingRequestinterface, which had no other reader and go too.export default X;lines removed from files that also exportXby name; nothing imported the default.@tiptap/extension-bullet-list,-ordered-listand-paragraphleavepackage.json. The barrel re-export was their only reference, and StarterKit already provides those nodes (they stay innode_modulesthrough it).mainin untouched lines are left alone, so the diff stays attributable.95 files changed, 1,867 lines removed, 22 added (the moved
Hubtype and trimmed import lines). No behaviour change intended.Checks
npm run lint: 0 errors (2 pre-existing warnings in untouched files)npm run type-check: cleanno-unused-varsrun ad hoc on every touched file: only findings that already existed onmainremainNot in this chunk
knip still lists ~400 exports that are only used inside their own file (dropping the
exportkeyword) and the undeclared transitive imports (highlight.js,@radix-ui/react-portal,@tanstack/react-query,wagmi). Both are separate, mechanical changes if wanted.Next
Chunk 6 (
retire/6-topic-pages) is the first product retirement and starts once this is merged.🤖 Generated with Claude Code