Skip to content

fix(lint): enforce focused-test, unused-code, and floating-promise rules - #836

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/lint-config-gaps
Nov 16, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/lint-config-gaps

Conversation

@morinokami

Copy link
Copy Markdown
Collaborator

Two lint settings in vite.config.ts look active but check nothing, and unused code goes unreported in the platform:

  • jest/no-focused-tests is dropped from the effective config because the Jest plugin isn't enabled, so it.only and describe.only pass vp lint and the pre-commit hook. Vitest rejects .only in CI, but a local run passes while it skips the file's other tests.
  • vp run lint:platform passes --type-aware, but the config enables no type-aware rule, so it reports the same as a plain vp lint. An unawaited promise passes.
  • no-unused-vars is off: the correctness category is off and the rule was never re-enabled. The SDK packages catch unused locals with TypeScript's noUnusedLocals, but the platform packages, packages/isr, and .mjs scripts have no check, and 17 unused imports, variables, and test helpers had built up in the platform.

Fix

  • Use vitest/no-focused-tests. The vitest plugin is already enabled.
  • Enable no-floating-promises. Plain vp lint skips type-aware rules, so only vp run lint:platform applies it. The platform has no violations. With a type-aware rule enabled, that task now runs the type checker: about 3 s locally instead of 1 s.
  • Enable no-unused-vars without checking parameters, matching the SDK packages, where TypeScript's noUnusedLocals is on and noUnusedParameters is off. An options object turns off oxlint's default ^_ ignore pattern, and the code uses _ names on purpose, so varsIgnorePattern: '^_' restates it. Without it, the rule reports 98 of those names.
  • Leave platform/packages/api/src/admin/fate/client.generated.ts out of lint, as fmt already does. @nkzw/fate imports mutation there without using it.
  • Remove what the rule found. Behavior doesn't change:
    • dispatch/src/isr.ts imported six names that it only re-exports with a separate export { … } from '@void/isr/core'.
    • The proxy's inbound-email test helpers (streamOf, createInboundMessage, createCtx, routeInboundMessage) have had no callers since inbound handling moved to the email gateway in feat(email): align platform email with authoritative gateway design #331. The proxy Worker only exports fetch.
    • routeRelayed in the email gateway still requires authoritative.slug; only an unused copy of it is gone.
    • The rest are unused imports, a destructured variable, a type alias, and one more test helper.

Verification

  • Temporary files confirmed that each rule reports its case: it.only and an unused import in an .mjs file in vp lint, and an unawaited call under platform/ in vp run lint:platform only.
  • vp lint, vp run lint:platform, vp fmt --check, and vp run check pass.
  • Full suite after a package rebuild: 806 files and 17,064 tests pass; 1 file and 32 tests are skipped.

🤖 Generated with Claude Code

`jest/no-focused-tests` never ran because the Jest plugin is not
enabled, so `.only` passed lint and the pre-commit hook. Use the Vitest
rule instead.

The type-aware platform lint enabled no type-aware rules. Enable
`no-floating-promises`, which only `vp run lint:platform` applies;
plain `vp lint` skips it. The platform has no existing violations.

Unused imports and variables went unreported where TypeScript's
`noUnusedLocals` is off, including the platform packages and JS
scripts. Enable `no-unused-vars` (parameters excluded, `^_` names
ignored) and remove the 17 unused imports, variables, and test helpers
it found. The proxy's inbound-email test helpers were left over from
moving inbound handling to the email gateway. Skip the generated fate
client, which can import helpers it does not use.

Validation:
- Temporary files confirmed that each rule reports its case.
- `vp lint`, `vp run lint:platform`, `vp fmt --check`, and
  `vp run check` pass.
- Full suite after a package rebuild: 17,013 tests pass, 32 skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@cpojer
cpojer merged commit 5f2f3a5 into voidzero-dev:main Nov 16, 2026
18 checks passed
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.

2 participants