fix(dead-code): re-exports not counted as usage, causing false positives#206
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
export type {X} from './y' (and export {X} from './y' without 'type')
consume X from the source module — but the import-collection regex only
matched 'import {X} from', never 'export {X} from'. Any symbol only ever
re-exported (never plain-imported) was incorrectly flagged unused.
Found via real-codebase validation (Coretax-Auto-Downloader extension):
ProductAccess/AuthUser defined in google-auth-cache.ts, re-exported via
'export type {...} from' in google-auth.ts, flagged unused despite being
consumed downstream through the re-export.
Also fixes the re-export regex itself, which required 'export {' and
never matched 'export type {' at all.
|
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.



Found while validating dead-code breakdown against real codebase (Coretax-Auto-Downloader extension).
export type {X} from './y'(andexport {X} from './y') consume X from the source module, but the import-collection regex only matchedimport {X} from. Any symbol only re-exported (never plain-imported) was flagged unused.Verified:
ProductAccess/AuthUser(auth/google-auth-cache.ts) re-exported viaexport type {...} fromin auth/google-auth.ts — false positive before fix, gone after fix.Also fixes the re-export regex itself: it required
export {and never matchedexport type {at all, so type-only re-exports weren't even tracked asre_exportentries.Test suite: 1 pre-existing failure (
test_dead_code_json_output_has_schema_version) confirmed present on main before this change too — unrelated.