Skip to content

main does not lint: core/dev/token-report.mjs:24 imports readFileSync and never uses it #808

Closed
Birfy/FlyBot
#26

Description

@Birfy

What happens

main at 61a6af6f does not lint. Fork push run 39898995417, job 120236273977, step Lint (npm run lint in core/):

##[error]Identifier 'readFileSync' is imported but never used.
Found 43 warnings and 1 error.
##[error]Process completed with exit code 1.

The check-run annotation names the file: dev/token-report.mjs line 24 — core/dev/token-report.mjs:24, import { existsSync, readFileSync } from 'node:fs'. The identifier appears nowhere else in the 365-line file, so the import is dead.

Why it was not seen earlier

The file arrived with #802, which was merged at 04:00:56Z through a temporarily disabled ruleset on local evidence: the upstream Test workflow has been running with 0 steps since the Actions billing lock, so npm run lint never executed on that PR. The fork's CI is alive, and it executed the step for real.

Why it matters

npm run lint is a step of the ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 job, which is a required check in this repository. Until this is fixed, every pull request — on the fork and on upstream once the lock clears — carries a red required check that has nothing to do with its own diff, and "fork CI green" cannot be used as merge evidence.

Fix

Drop readFileSync from that one import: import { existsSync } from 'node:fs'. Nothing else changes — existsSync is what the missing---db guard uses, so it must stay.

Done when

  • npm --prefix core run lint exits 0 with 0 error (warnings unchanged at 43).
  • node core/dev/token-report.mjs with no --db still exits non-zero naming the path, and core/test/token-report.test.js still passes — the guard that uses existsSync must not be collateral.
  • A run on main shows Lint green in the ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 job.

Kill conditions

  • Remove existsSync instead of readFileSync → the missing---db test fails.
  • Leave the import and silence the rule → 0 error is not reached.

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 23, 2026
  2. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claimed. Branch fix/808-unused-import on Birfy/FlyBot, pull request Birfy/FlyBot#24 at fed5de60.

    One line: core/dev/token-report.mjs loses readFileSync from its node:fs import (existsSync stays — the missing --db guard uses it). Local oxlint on that tree: 1 error before, 0 errors after; test/token-report.test.js 5/5.

  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  4. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Branch: fix/808-unused-import-patch-copy on Birfy/FlyBot, pull request Birfy#26 (base main).

    One thing the issue does not say, and it changes the size of the fix: the file exists twice. patches/ds-bot/files/dev/token-report.mjs stores it verbatim, and ds-bot-patches check requires core/ to equal ds-bot/ + patches/ds-bot/. So the line has to change in both copies. With only core/dev/token-report.mjs edited, package fails at ds-bot/ matches the pin, patches apply, core/ is ds-bot/ + patches (#34):

    ds-bot-patches: core/ is not ds-bot/ + patches/ds-bot/ (edit core/, then run generate; or run apply):
      core/dev/token-report.mjs: differs from ds-bot/ + patches
    

    Verified locally on the change: ds-bot-patches check exit 0 (ok core/ equals ds-bot/ + patches/ds-bot/), core/scripts/lint.mjs → Found 44 warnings and 0 errors exit 0, test/token-report.test.js 5/5.

    Note for the queue: Birfy#24 already edits the same line but only core/, so it cannot turn package green on its own.

  5. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    agent-prPull request opened by an agent
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationScheduled tasks and automationbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions