Skip to content

chore: fix the eslint errors that fail the lint job - #436

Closed
PerryLink wants to merge 1 commit into
satorijs:mainfrom
PerryLink:chore/lint-cleanup
Closed

PerryLink wants to merge 1 commit into
satorijs:mainfrom
PerryLink:chore/lint-cleanup

Conversation

@PerryLink

Copy link
Copy Markdown
Contributor

yarn lint exits 1 on main with 30 errors, and the lint job never shows it: Install fails first, so Lint is skipped. This removes the dead code so the job can go green.

What it fixes

On main at db22bb3c:

$ corepack yarn lint
✖ 36 problems (30 errors, 6 warnings)

The 30 errors are three groups:

count rule sites
25 @typescript-eslint/no-unused-vars 'Context' is defined but never used
4 padded-blocks adapters/kook/src/http.ts, adapters/slack/src/http.ts
1 lines-between-class-members adapters/slack/src/ws.ts

The unused Context imports are leftovers from fc61aa1 ("refa: remove context generics") and the refactors around it: those commits dropped the Context type argument from the encoder and client classes and left the import behind. The rule is error in .eslintrc.yml.

Why it has been invisible

The lint job's steps on the current main tip (run 37651177817): Enable Corepack success, Install failure, Lint skipped. Install dies on @cordisjs/url-is-local@^1.0.0, which is not on npm, so Lint has not run for months. Once install works again, Lint will run, and this is what it will report.

This is a regression, not unenforced style. The job was green until 5f2b43ae (2026-04-12) and red from fc61aa1b (2026-04-13) on, the commit that removed the context generics. Install still worked until 04-21, so Lint really did run and really did fail on those runs.

Left alone

The 6 remaining warnings: 5 x sort-imports and 1 x max-len. ESLint exits 0 with warnings only, and the script has no --max-warnings, so they do not affect the job. --fix also moves as-aliased specifiers to the front of the list (text as $text ahead of at), which reads worse. No lint rule or config was changed.

Verification

Cold, with .eslintcache deleted first, since CI never has one:

before: exit 1 — 36 problems (30 errors, 6 warnings)
after : exit 0 —  6 problems ( 0 errors, 6 warnings)

yarn build is already red here for unrelated reasons, so I compared tsc error sets rather than counts, after deleting every *.tsbuildinfo and every emitted lib/ — a warm build hides TS errors:

before: 70 errors in 44 files  (TS2724 x37, TS2554 x23, TS2339 x8, TS2769 x1, TS2559 x1)
after : 70 errors in 44 files  (TS2724 x37, TS2554 x23, TS2339 x8, TS2769 x1, TS2559 x1)

Diffing on file, line, column, code and message: 0 new, 0 removed. Three TS2724 diagnostics shift up one line because the import line above them was deleted; they are otherwise identical.

Every changed line is either an import { ... } from '@satorijs/core' line or a blank line, checked over the whole diff (+22/-29).

The two files that also carry declare module '@satorijs/core' (adapters/line/src/index.ts, adapters/telegram/src/index.ts) keep a working augmentation: Session['line'] and Session['telegram'] still resolve, next to a bogus property as a live negative control, which does error.

corepack yarn test exits 0 with # tests 0, # suites 2. The suite has no it() blocks, so it is unchanged either way.

`yarn lint` exits 1 on main with 30 errors:

- 25 x `@typescript-eslint/no-unused-vars` for a `Context` import that
  no longer has a use. They were left behind by fc61aa1 ("refa: remove
  context generics") and the refactors around it, which dropped the
  `Context` type argument from the encoder and client classes.
- 4 x `padded-blocks` and 1 x `lines-between-class-members` in the kook
  and slack http servers.

The failure has been masked because Install fails first, so the Lint
step is skipped. Remove the dead imports and the stray blank lines.
No behaviour changes.
@PerryLink

Copy link
Copy Markdown
Contributor Author

Closing this: it cannot get past the install step on main, and the lint errors it fixes are no longer the blocking issue.

@PerryLink PerryLink closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant