Skip to content

Move the complexity gate from ESLint to Biome - #185

Merged
rodrigobnogueira merged 1 commit into
mainfrom
chore/biome-complexity-gate
Oct 4, 2026
Merged

rodrigobnogueira merged 1 commit into
mainfrom
chore/biome-complexity-gate

Conversation

@rodrigobnogueira

Copy link
Copy Markdown
Collaborator

Summary

This repo used ESLint for one rule, sonarjs/cognitive-complexity, with
@typescript-eslint/parser only to parse TypeScript, and that parser
refuses TypeScript 7, so a lint dependency gated the compiler. Biome
enforces the same ceiling of 15 with noExcessiveCognitiveComplexity
(biome.json), has no TypeScript dependency, and drops the ESLint
toolchain, as @nest-native/jobs did. The report reads Biome's JSON and
refuses an empty scope or a truncated run; CI's base-branch report
degrades to no baseline when the tooling changed since the base commit.

Scope Check

  • This PR is package/library work.
  • This PR is sample/docs/CI work.
  • If this is sample work, it does not include packages/trpc/**
    changes.

Validation

  • Relevant local checks are listed below.
# npm run complexity:check and complexity:report pass under Biome

Security Pass

  • Dependency changes reviewed: ESLint, @typescript-eslint/parser and eslint-plugin-sonarjs removed; @biomejs/biome added (dev only).
  • Runtime behavior reviewed: none; dev tooling only.
  • Secrets or sensitive data checked: none involved.

This repo used ESLint for one rule, sonarjs/cognitive-complexity, with
@typescript-eslint/parser only to parse TypeScript, and that parser
refuses TypeScript 7, so a lint dependency gated the compiler. Biome
enforces the same ceiling of 15 with noExcessiveCognitiveComplexity
(biome.json), has no TypeScript dependency, and drops the ESLint
toolchain, as @nest-native/jobs did. The report reads Biome's JSON and
refuses an empty scope or a truncated run; CI's base-branch report
degrades to no baseline when the tooling changed since the base commit.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

📊 Coverage Coverage Report

Metric PR Base Diff
Statements ████████████████████ 660/660 (100%) 660/660 (100%) ⚪ 0%
Branches ████████████████████ 280/280 (100%) 280/280 (100%) ⚪ 0%
Functions ████████████████████ 122/122 (100%) 122/122 (100%) ⚪ 0%
Lines ████████████████████ 635/635 (100%) 635/635 (100%) ⚪ 0%

Updated for 78d4a4e | Compared against base branch

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

⏱️ Performance Report

✅ Tests 216 passed, 0 failed, 0 skipped
🧪 Suites 43
⏱️ Total step time 10.00s (install + tests) 🟢 -1.00s
⚙️ Test execution 3.13s 🟢 -81ms
🐢 Slowest test suites
# Suite Tests Duration vs Base
1 test/generators/schema-generator.spec.ts 23 2.26s 🟢 -67ms
2 test/adapter/trpc-client-adapter-e2e.spec.ts 16 185ms ⚪ ~0
3 test/adapter/trpc-http-adapter.spec.ts 19 75ms ⚪ ~0
4 test/router/trpc-router.spec.ts 29 38ms ⚪ ~0
5 test/context/trpc-context-creator.spec.ts 26 36ms ⚪ ~0
6 test/adapter/trpc-http-adapter-unit.spec.ts 22 20ms ⚪ ~0
7 test/generators/zod-serializer.spec.ts 38 11ms ⚪ ~0
8 test/router/trpc-router-lifecycle.spec.ts 11 10ms ⚪ ~0
9 test/decorators/decorators.spec.ts 11 7ms ⚪ ~0
10 test/module/trpc-module.spec.ts 9 7ms ⚪ ~0
🐌 Slowest individual tests
# Suite Test Duration vs Base
1 schema-generator generateSchemaContent (type-level AppRouter contract) should require a link transformer on typed clients when generated with hasTransformer 1.41s 🟢 -60ms
2 schema-generator generateSchemaContent (type-level AppRouter contract) should typecheck generated AppRouter with a typed tRPC client 845ms ⚪ ~0
3 trpc-client-adapter-e2e real @trpc/client adapter E2E express handles typed queries, mutations, and context extraction 70ms ⚪ ~0
4 trpc-client-adapter-e2e real @trpc/client adapter E2E express streams subscriptions through the real client 22ms ⚪ ~0
5 trpc-client-adapter-e2e real @trpc/client adapter E2E express runs class-validator DTO validation through ValidationPipe 21ms ⚪ ~0
6 trpc-client-adapter-e2e real @trpc/client adapter E2E fastify handles typed queries, mutations, and context extraction 12ms ⚪ ~0
7 trpc-client-adapter-e2e real @trpc/client adapter E2E fastify runs class-validator DTO validation through ValidationPipe 10ms ⚪ ~0
8 trpc-http-adapter TrpcHttpAdapter edge cases should handle Fastify GET with createContext 10ms ⚪ ~0
9 trpc-client-adapter-e2e real @trpc/client adapter E2E express reports Zod input errors through the real client 8ms ⚪ ~0
10 trpc-client-adapter-e2e real @trpc/client adapter E2E fastify streams subscriptions through the real client 6ms ⚪ ~0
11 trpc-client-adapter-e2e real @trpc/client with superjson transformer E2E express round-trips Date instances through queries 6ms ⚪ ~0
12 trpc-http-adapter TrpcHttpAdapter (server config passthrough) Express should apply responseMeta headers before streaming SSE responses 6ms ⚪ ~0
13 trpc-client-adapter-e2e real @trpc/client adapter E2E fastify reports Zod input errors through the real client 5ms ⚪ ~0
14 trpc-client-adapter-e2e real @trpc/client with superjson transformer E2E express round-trips Date instances through mutation inputs and outputs 5ms ⚪ ~0
15 trpc-http-adapter TrpcHttpAdapter Express handler should apply method pipes and interceptors through HTTP requests 5ms ⚪ ~0

Updated for 78d4a4e | Compared against base branch

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

🧠 Cognitive Complexity Report

Metric PR Base Diff
Total complexity 201 159 🔴 +42
Max function complexity 15 12 🔴 +3
Functions measured 43 53 ⚪ -10
🧩 Most complex functions
Function Location Complexity Status
serializeZodSchema packages/trpc/generators/zod-serializer.ts:9 15 🟡 Watch
TrpcContextCreator.createHandler → callback packages/trpc/context/trpc-context-creator.ts:255 13 🟢 OK
generateSchemaContent packages/trpc/generators/schema-generator.ts:59 11 🟢 OK
TrpcHttpAdapter.resolveBody packages/trpc/trpc-http-adapter.ts:124 9 🟢 OK
TrpcContextCreator.extractHttpExceptionMessage packages/trpc/context/trpc-context-creator.ts:479 7 🟢 OK
createProcedureDecorator → callback packages/trpc/decorators/procedure.decorator.ts:35 7 🟢 OK
TrpcRouter.createSubscriptionProcedure → callback packages/trpc/trpc-router.ts:320 7 🟢 OK
TrpcRouter.resolveContextId packages/trpc/trpc-router.ts:504 7 🟢 OK
TrpcRouter.validateSubscriptionOutput packages/trpc/trpc-router.ts:551 7 🟢 OK
mapProcedure packages/trpc/generators/schema-generator.ts:104 6 🟢 OK

🧭 Cognitive complexity is reported as a review signal, not a merge gate. Prefer small, intention-revealing refactors when complexity rises.


Updated for 78d4a4e | Compared against base branch

@rodrigobnogueira
rodrigobnogueira merged commit 458c022 into main Oct 4, 2026
12 checks passed
@rodrigobnogueira
rodrigobnogueira deleted the chore/biome-complexity-gate branch October 4, 2026 23:31
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.

1 participant