style: replace banned Function type in cli test - #1056
Merged
Conversation
Replace the banned `Function` type with a typed execFile callback alias (`ExecCb`) in desktop/src/main/__tests__/cli.test.ts.
Fixes 5 biome `lint/complexity/noBannedTypes` findings (lines 67, 99, 130, 156, 211) where mock execFile implementations used `callback: Function`. The new alias types the callback as `(error: Error | null, result: { stdout: string; stderr: string }) => void`, matching the mock's actual usage.
No behavioral changes; tests and tsc still pass.
This PR was created by an AI agent as part of an automated daily lint fix job.
✅ Deploy Preview for images-devsy-sh canceled.
|
✅ Deploy Preview for devsydev canceled.
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
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.
Linter + category
biome —
lint/complexity/noBannedTypesFindings fixed (count)
5 findings in
desktop/src/main/__tests__/cli.test.ts(lines 67, 99, 130, 156, 211), each using the bannedFunctiontype for the mockexecFilecallback parameter.Fix method
Mechanical. Replaced
callback: Functionwith a typed aliasExecCb:The alias matches the mock's actual call sites (
callback(null, { stdout, stderr })/callback(error, { stdout, stderr })).erroris typedError | null(rather thanNodeJS.ErrnoException | null) because the mock constructs its error asError & { code: number; stderr: string }, whose numericcodeis incompatible withErrnoException.code: string. No behavioral changes.Verification performed
biome check desktop/src/main/__tests__/cli.test.ts: all 5noBannedTypeswarnings resolved; only pre-existing format drift remains (present onmainbefore this change).tsc --noEmit -p tsconfig.json(desktop main process): 0 errors.vitest run src/main/__tests__/cli.test.ts: 10/10 tests pass.Scope note
No overlap with PR #1042 (
style: extract jetbrains goconst literals to constants), which is a Gogolangci-lintchange inpkg/ide/jetbrains/. This PR is a biome fix in the desktop workspace — different linter, language, and files.This PR was created by an AI agent as part of an automated daily lint fix job.