diff --git a/src/components/organisms/DataSearch/ReadingCards.tsx b/src/components/organisms/DataSearch/ReadingCards.tsx index a91c00c..4ce4081 100644 --- a/src/components/organisms/DataSearch/ReadingCards.tsx +++ b/src/components/organisms/DataSearch/ReadingCards.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any -- takes candidate specs as `any` and reads only the members it renders, tolerating any that is missing */ 'use client'; import { useMemo } from 'react'; @@ -10,7 +9,7 @@ import Button from '@/components/atoms/Button/Button'; import { isClosestMatch } from '@/lib/search/departures'; import { basisNote, readingOf, readingsSummary } from '@/lib/search/readings'; import { tokenAbout } from '@/lib/search/tokenAbout'; -import type { CandidatesPart } from '@/lib/search/types'; +import type { CandidatesPart, Spec } from '@/lib/search/types'; import { statVarsUnreadable } from '@/lib/search/view'; /** @@ -32,11 +31,11 @@ const ReadingCards = ({ part: CandidatesPart; // The part's variable text, when the answer has several parts. prefix: string | null; - onPick: (spec: any) => void; + onPick: (spec: Spec) => void; // Re-runs the question, for a reading the client could not read. onRetry: () => void; }) => { - const specs: any[] = useMemo(() => part.candidates.specs, [part]); + const specs = useMemo(() => part.candidates.specs, [part]); const readings = useMemo( () => specs.map((spec) => { diff --git a/src/components/organisms/DataSearch/SearchCards.tsx b/src/components/organisms/DataSearch/SearchCards.tsx index a7e6627..24ead24 100644 --- a/src/components/organisms/DataSearch/SearchCards.tsx +++ b/src/components/organisms/DataSearch/SearchCards.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any -- takes specs as `any` and reads only the members it renders, tolerating any that is missing */ 'use client'; import classNames from 'classnames'; @@ -21,12 +20,12 @@ import { specOrigin, statVarsUnreadable, } from '@/lib/search/view'; -import { knownPart, type ParsedPart, type Part } from '@/lib/search/types'; +import { knownPart, type ParsedPart, type Part, type PartSpec } from '@/lib/search/types'; // A card's meta line, its coverage then its origin (specOrigin beside the // spec's own sentence, shapeOrigin beside any other title). The line clamps // at two lines, so the full text goes in the title attribute. -const CardMeta = ({ spec, origin }: { spec: any; origin: string | null }) => { +const CardMeta = ({ spec, origin }: { spec: PartSpec; origin: string | null }) => { const meta = [coverageSummary(spec), origin].filter(Boolean).join(' · '); return ( @@ -97,7 +96,7 @@ const SearchCards = ({ Multiple possible interpretations found. Select the best fit…