Skip to content

Replace the any casts in @bb/sqlite with a shared CommitHashEntry type #122

@bharatsachya

Description

@bharatsachya

Type: type-safety / architecture · Difficulty: medium

The only any usages in the repo are all in @bb/sqlite and violate the "never any" rule: aggregateStats.ts:97 (pickCommits(source: any)), :127 (deriveRepoName(source: any, info: any)), knowledge.ts:74 (push({…} as any)). aggregateStats.ts also defines a CommitHashRecord that is structurally identical to the object pushed in knowledge.ts.

Do: define a shared CommitHashEntry type in @bb/types, reuse it in both files; type pickCommits(source: unknown) and narrow; type deriveRepoName params from KnowledgeDoc["source"]/["info"]. Remove the as any and the eslint-disable comments.

Done when: no any remains in @bb/sqlite; the commit-hash shape lives in one place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions