Skip to content

packages/sdk: eslint cannot run, so nothing lints that package #1335

Description

@feruzm

Noticed while checking a review finding on #1327 that claimed configured ESLint errors. The finding could not be reproduced because the linter does not run at all.

packages/sdk/package.json declares "lint": "eslint ." and the package has an eslint.config.mjs, but invoking it throws:

Error: Key "rules": Key "@typescript-eslint/no-explicit-any": Could not find "no-explicit-any" in plugin "@typescript-eslint"
    at Object.create (.../@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
    at createRuleListeners (.../eslint@8.57.1/.../linter.js:895:21)

The workspace resolves eslint@8.57.1 while the installed @typescript-eslint build targets eslint 9. The CI lint job is green because it does not cover this package.

Why it matters beyond the one finding

Nothing is checking packages/sdk today, so conventions drift silently and any review comment about lint rules there is unfalsifiable: it cannot be confirmed or refuted by running the tooling. The same is worth checking for the other packages, since a version mismatch of this kind is rarely confined to one of them.

Suggested order

  1. Fix the resolution so pnpm --filter @ecency/sdk lint runs. Either move the workspace to eslint 9 or pin @typescript-eslint to a build that supports eslint 8, whichever matches what the other packages expect.
  2. See what it reports once it runs. Expect a backlog rather than a clean sheet.
  3. Then decide about the as any casts in get-posts-ranked-query-options.spec.ts, which is where this started. There were 15 on develop before refactor(sdk): drop the dead hasNextPage page param and stabilise the display select #1327 and 14 after, so they are the file's existing convention rather than anything that PR introduced. Narrowing them means typing queryFn, getNextPageParamandselectthrough theinfiniteQueryOptions` generics, which is worth doing for the whole file at once.
  4. Add the package to whatever CI job is meant to cover it, otherwise this recurs.

Doing 3 before 1 would be tidying a file with nothing to keep it tidy afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions