components/search-command.tsx:90 and :106 use as any to walk the React Query cache and pull bounty objects out of nested response shapes:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const record = obj as any;
// ...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const proj = bounty.project as any;
The cast hides which shapes the walker actually handles (BountiesQuery, infinite-query pages, raw arrays, nested project records) and the ESLint disable comments are a code smell.
What to do
- Define a
CacheRecord union covering the shapes extractFromObject actually traverses (e.g. BountyFieldsFragment | { bounties: { bounties: BountyFieldsFragment[] } } | { data: BountyFieldsFragment[] } | { pages: ... })
- Use type predicates (
function isBountyFragment(obj: unknown): obj is BountyFieldsFragment) instead of duck-typing with as any
- Drop both
eslint-disable comments
Acceptance criteria
- No
as any or eslint-disable for no-explicit-any in search-command.tsx
- Same runtime behavior, Cmd+K still finds cached bounties and projects
pnpm tsc --noEmit and pnpm lint pass
Files
components/search-command.tsx
components/search-command.tsx:90and:106useas anyto walk the React Query cache and pull bounty objects out of nested response shapes:The cast hides which shapes the walker actually handles (BountiesQuery, infinite-query pages, raw arrays, nested project records) and the ESLint disable comments are a code smell.
What to do
CacheRecordunion covering the shapesextractFromObjectactually traverses (e.g.BountyFieldsFragment | { bounties: { bounties: BountyFieldsFragment[] } } | { data: BountyFieldsFragment[] } | { pages: ... })function isBountyFragment(obj: unknown): obj is BountyFieldsFragment) instead of duck-typing withas anyeslint-disablecommentsAcceptance criteria
as anyoreslint-disableforno-explicit-anyinsearch-command.tsxpnpm tsc --noEmitandpnpm lintpassFiles
components/search-command.tsx