Skip to content

Disable unicorn/max-nested-calls#294

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-max-nested-calls
Jun 22, 2026
Merged

Disable unicorn/max-nested-calls#294
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-max-nested-calls

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

From #279. The call-depth cap (max 3) fires only on the two patterns this repo nests deeply on purpose, both of which read better nested than split into temporaries — so it's turned off rather than left as standing warnings (same call as the other ill-fitting rules in #287/#288).

Why off

All 16 hits are one of:

  • zod schema buildersz.record(z.string(), z.union([z.string(), z.number()])) in message-schemas.ts. Splitting these into intermediate schema consts is more awkward than the inline builder.
  • fast-check generators in property tests — fc.array(fc.tuple(fc.nat(20), fc.integer({ min: 1, max: 20 }))) etc. Deeply-nested combinators are the idiomatic, readable form.

Neither has a clean path to error. Disabled with a rationale comment alongside the other rules that don't fit this codebase.

Change

  • eslint.config.js: max-nested-calls warnoff.

Verification

  • bun run check exit 0 (no violations)

Refs #279

From #279. The call-depth cap (max 3) fires only on the two places this repo
nests deeply on purpose, both of which read better nested than split into
temporaries:
- zod schema builders, e.g.
  `z.record(z.string(), z.union([z.string(), z.number()]))`
- fast-check generators in property tests, e.g.
  `fc.array(fc.tuple(fc.nat(20), fc.integer({ min: 1, max: 20 })))`

No path to `error` without contorting idiomatic builder/combinator code, so
turn it off rather than leave standing warnings.

Refs #279

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 22, 2026 2:15pm

Request Review

@twschiller twschiller merged commit d8dde56 into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-max-nested-calls branch June 22, 2026 14:17
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