Skip to content

style: replace banned Function type in cli test - #1056

Merged
skevetter merged 1 commit into
mainfrom
lint-fixer/cli-test-nobannedtypes
Aug 16, 2026
Merged

style: replace banned Function type in cli test#1056
skevetter merged 1 commit into
mainfrom
lint-fixer/cli-test-nobannedtypes

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Linter + category

biome — lint/complexity/noBannedTypes

Findings fixed (count)

5 findings in desktop/src/main/__tests__/cli.test.ts (lines 67, 99, 130, 156, 211), each using the banned Function type for the mock execFile callback parameter.

Fix method

Mechanical. Replaced callback: Function with a typed alias ExecCb:

type ExecCb = (
  error: Error | null,
  result: { stdout: string; stderr: string },
) => void

The alias matches the mock's actual call sites (callback(null, { stdout, stderr }) / callback(error, { stdout, stderr })). error is typed Error | null (rather than NodeJS.ErrnoException | null) because the mock constructs its error as Error & { code: number; stderr: string }, whose numeric code is incompatible with ErrnoException.code: string. No behavioral changes.

Verification performed

  • biome check desktop/src/main/__tests__/cli.test.ts: all 5 noBannedTypes warnings resolved; only pre-existing format drift remains (present on main before 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 Go golangci-lint change in pkg/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.

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.
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit e0d2e71
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a803a6a65dece0008fd473a

@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit e0d2e71
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a803a6a3deb990008ed974e

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter merged commit 413c41d into main Aug 16, 2026
29 checks passed
@skevetter
skevetter deleted the lint-fixer/cli-test-nobannedtypes branch August 16, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant