mono - refactor: add KeyvAny/KeyvAnyArray types and replace explicit any - #2010
Merged
Conversation
Introduce shared `KeyvAny` (=== any) and `KeyvAnyArray` (=== any[]) types in core/keyv (`src/types/keyv.ts`), exported from the public API. A single `noExplicitAny` biome suppression now lives at the type definition instead of being scattered across the codebase. Replace `any`/`any[]` in type positions with `KeyvAny`/`KeyvAnyArray` across core (keyv, bigmap, test-suite) and all storage adapters (etcd, mongo, mysql, postgres, redis, sqlite, valkey), importing the types from `keyv`, and remove the now-redundant per-line and file-level `biome-ignore lint/suspicious/ noExplicitAny` comments. Purely type-level; runtime behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzGVTfZQrMHxZ4WDKGw5wQ
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase by centralizing dynamic any types into KeyvAny and KeyvAnyArray across several packages, allowing the removal of numerous biome-ignore lint suppressions. Feedback suggests using the GenericValue type parameter instead of KeyvAny for the iterator() method in Keyv to preserve type safety for consumers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2010 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 55 55
Lines 4887 4887
Branches 784 785 +1
=========================================
Hits 4887 4887 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Refactor (type-level only — no runtime behavior change).
Introduces two shared types in
core/keyv(src/types/keyv.ts), exported from the public API:A single
noExplicitAnysuppression now lives at the type definition instead of being scattered across the codebase. Allany/any[]usages in type positions across the packages are replaced withKeyvAny/KeyvAnyArray(imported fromkeyv), and the now-redundant per-line// biome-ignore lint/suspicious/noExplicitAnycomments and file-level// biome-ignore-allheaders are removed (including a stale one instorage/redis/src/types.tsthat suppressed nothing).Packages touched:
keyv,bigmap,test-suite, and theetcd,mongo,mysql,postgres,redis,sqlite,valkeystorage adapters.Verification
pnpm build— all 20 packages build cleanly.biome check --error-on-warnings— passes on all changed files.anyin source is the single centralizedKeyvAnydefinition.🤖 Generated with Claude Code
https://claude.ai/code/session_01XzGVTfZQrMHxZ4WDKGw5wQ
Generated by Claude Code