Repository navigation
fix(lint): enforce focused-test, unused-code, and floating-promise rules - #836
Merged
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two lint settings in
vite.config.tslook active but check nothing, and unused code goes unreported in the platform:jest/no-focused-testsis dropped from the effective config because the Jest plugin isn't enabled, soit.onlyanddescribe.onlypassvp lintand the pre-commit hook. Vitest rejects.onlyin CI, but a local run passes while it skips the file's other tests.vp run lint:platformpasses--type-aware, but the config enables no type-aware rule, so it reports the same as a plainvp lint. An unawaited promise passes.no-unused-varsis off: thecorrectnesscategory is off and the rule was never re-enabled. The SDK packages catch unused locals with TypeScript'snoUnusedLocals, but the platform packages,packages/isr, and.mjsscripts have no check, and 17 unused imports, variables, and test helpers had built up in the platform.Fix
vitest/no-focused-tests. Thevitestplugin is already enabled.no-floating-promises. Plainvp lintskips type-aware rules, so onlyvp run lint:platformapplies 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.no-unused-varswithout checking parameters, matching the SDK packages, where TypeScript'snoUnusedLocalsis on andnoUnusedParametersis off. An options object turns off oxlint's default^_ignore pattern, and the code uses_names on purpose, sovarsIgnorePattern: '^_'restates it. Without it, the rule reports 98 of those names.platform/packages/api/src/admin/fate/client.generated.tsout of lint, asfmtalready does.@nkzw/fateimportsmutationthere without using it.dispatch/src/isr.tsimported six names that it only re-exports with a separateexport { … } from '@void/isr/core'.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 exportsfetch.routeRelayedin the email gateway still requiresauthoritative.slug; only an unused copy of it is gone.Verification
it.onlyand an unused import in an.mjsfile invp lint, and an unawaited call underplatform/invp run lint:platformonly.vp lint,vp run lint:platform,vp fmt --check, andvp run checkpass.🤖 Generated with Claude Code