fix: remove unused imports (RefObject, Int32)#663
Merged
Conversation
These imports are declared but never used, which triggers TS6133 errors for consumers that type-check the library source (via the package's "react-native" export condition pointing to src/) with noUnusedLocals enabled. - src/index.tsx: drop unused `RefObject` (only `React.RefObject` is used) - src/specs/NativeRNViewShot.ts: drop unused `Int32`
d12f0c9 to
4595666
Compare
gre
pushed a commit
that referenced
this pull request
Jun 24, 2026
The package's `react-native` export condition resolves consumers to the
raw `src/*.tsx` source. Strict consumer tsconfigs then type-check our
source and surface TS6133 ("declared but never read") on any unused
import — and `skipLibCheck` cannot suppress it because these are
`.tsx`/`.ts`, not `.d.ts`.
Enabling these flags in our own tsconfig makes `npm run type-check`
(already gating CI) catch the same class of error before publish, so it
can never reach consumers again.
Fails on current master (unused `RefObject` in src/index.tsx and `Int32`
in src/specs/NativeRNViewShot.ts); goes green once those imports are
removed (#663).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Two imports in the library source are declared but never used:
RefObjectinsrc/index.tsx— onlyReact.RefObject(the qualified form) is referencedInt32insrc/specs/NativeRNViewShot.tsskipLibCheckdoes not help here since these are.tsx/.tssource files, not.d.ts.