refactor: remove unused exports flagged by Fallow - #670
Merged
Conversation
Fallow (fallow dead-code --unused-exports) flagged 1676 unused exports; all but a handful sit in generated tests/, examples/, and __snapshots__ output that stays as-is. The hand-written ones are fixed here: plugin-ts factory helpers become module-private, the react-query/swr/vue-query utils drop re-exports nothing imports, and the unused mockedPluginDriver mock is deleted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014dHSbuoSN5pYaXowWwZj5B
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 8ed9772 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@kubb/plugin-axios
@kubb/plugin-cypress
@kubb/plugin-faker
@kubb/plugin-fetch
@kubb/plugin-mcp
@kubb/plugin-msw
@kubb/plugin-react-query
@kubb/plugin-redoc
@kubb/plugin-swr
@kubb/plugin-ts
@kubb/plugin-vue-query
@kubb/plugin-zod
commit: |
Contributor
|
Size Change: -241 B (-0.08%) Total Size: 319 kB 📦 View Changed
ℹ️ View Unchanged
|
This was referenced Jul 11, 2026
This was referenced Jul 11, 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.
🎯 Changes
Ran Fallow (
fallow dead-code --format json --quiet --unused-exportsandfallow dupes --mode mild) over the repo. It flagged 1676 unused exports, but nearly all of them live in Kubb-generated output (tests/3.0.x,examples/*,__snapshots__) that has to stay as-is. This PR fixes the hand-written ones:packages/plugin-ts/src/factory.ts: 14 factory helpers (createIndexSignature,createTypeAliasDeclaration,createInterfaceDeclaration, and thefactory.*aliases likecreateIdentifier,createTrue,createFalse) are now module-private, and the unusedexport { SyntaxKind }statement is gone. Every one of them is still used inside the file; nothing imported them from outside, includingfactory.test.ts.packages/plugin-react-query/src/utils.ts: drops theexport { resolveErrorNames, resolveSuccessNames }re-export. Both are still imported and used internally bybuildResponseTypes.packages/plugin-swr/src/utils.ts: drops the unusedresolveOperationOverridesre-export.packages/plugin-vue-query/src/utils.ts: drops the unusedbuildQueryKeyParamsandresolveOperationOverridesre-exports.configs/mocks.ts: deletes the unusedmockedPluginDriverand its now-unneeded import.None of these symbols are reachable through a package's public
exportsmap (each plugin exposes only.), so the published API is unchanged. A changeset with patch bumps for the four touched packages is included.Duplication scan for reference (
fallow dupes): the biggest hand-written clone families are theserializers.tstemplate shared verbatim between plugin-axios and plugin-fetch (427 lines), large shared blocks betweentemplates/axios.tsandtemplates/fetch.ts, and the InfiniteQueryOptions/SuspenseInfiniteQueryOptions components in react-query/vue-query. Consolidating those is a bigger refactor left out of this PR.Verified with
pnpm turbo run typecheckandtestfor the four packages (all green),pnpm lint, andpnpm format. A rerun of Fallow reports no remaining unused exports inpackages/,internals/, orconfigs/.✅ Checklist
pnpm run test.🚀 Release Impact
🤖 Generated with Claude Code
https://claude.ai/code/session_014dHSbuoSN5pYaXowWwZj5B
Generated by Claude Code