Skip to content

Rename the tus response helper so a new Biome rule stops matching it - #339

Merged
Serraniel merged 1 commit into
mainfrom
fix/tus-describe-name
Oct 30, 2026
Merged

Serraniel merged 1 commit into
mainfrom
fix/tus-describe-name

Conversation

@Serraniel

Copy link
Copy Markdown
Owner

#337 bumps Biome 2.5.15 → 2.6.2 and only one check goes red: Unit tests (TypeScript). No test fails. The job is named for the suite but runs npm run lint first, and that is what exits 1.

What the new version objects to

src/lib/tus.ts:162:47 lint/correctness/usePlaywrightValidDescribeCallback
  × Describe requires a callback function.
  > 162 │ throw new TusError(response.status, await describe(response));

Four times, same line shape. describe at src/lib/tus.ts:95 is a module-private helper that turns a failed Response into a human-readable message. Biome 2.6 promotes usePlaywrightValidDescribeCallback into the recommended set, and the rule matches any call named describe — it does not check that Playwright is imported, or that the name resolves to a local declaration eight lines up. tus.ts imports no Playwright and never did.

So this is a false positive, and the bump introduced no real defect.

Measured against the version on main, the delta is exactly one rule:

2.5.15 (on main) 2.6.2 (in #337)
errors 0 4
warnings 1 1
infos 3 3

The warning (noUnusedImports in theme.test.ts) and the info (noUselessConstructor in tus.test.ts) are pre-existing on main and non-blocking under both.

Why a rename and not an exemption

biome.json sets files.includes to ["src/**/*.ts", "*.json"]. The Playwright specs live in web/e2e, so Biome never lints them — the rule has no file in this repository it could legitimately fire on today. Switching it off would be correct right now and wrong the moment e2e comes into scope.

The name was the weaker half of the conflict anyway: tus.test.ts, immediately beside it, calls vitest's describe six times. A module-private helper had quietly taken one of the two or three most heavily reserved identifiers in a JavaScript test codebase. errorMessage(response) says what it returns.

Five lines, no behaviour change.

Verified

Both Biome versions, after the rename:

Checked 69 files in 47ms. No fixes applied.
Found 1 warning.
Found 3 infos.

Zero errors on 2.6.2 and on 2.5.15 — identical to the baseline, so this lands safely on main ahead of the bump. npm run lint exits 0, svelte-check reports 416 FILES 0 ERRORS 0 WARNINGS, the unit suite passes, and tus.ts holds 100% statement coverage.

After this merges

Rebase #337 and it should go green on its own. Nothing else in that PR touches our code.

Left alone deliberately

biome.json declares "$schema": ".../2.4.1/schema.json" while package.json pins 2.5.15 — stale, and #337 would make it staler. Not fixed here: Dependabot does not edit biome.json, so the drift returns on every bump and wants a gate rather than a one-off edit. Worth its own issue.

Also worth noting for the record: "recommended": true is what makes a Biome minor able to fail the build. That is the setting working as designed — new correctness rules arrive without being asked for — but it does mean Biome minors are not green by construction, and this will happen again.

🤖 Generated with Claude Code

Biome 2.6 promotes usePlaywrightValidDescribeCallback into the
recommended set, and the rule matches any call named describe without
checking that Playwright is in scope. The helper at src/lib/tus.ts:95 is
a module-private function that renders a failed Response as a message,
so all four of its call sites became lint errors on a minor Biome bump -
which is what turned #337 red.

Renaming rather than disabling the rule, because Biome only lints
src/**/*.ts: the Playwright specs in web/e2e are outside files.includes,
so the rule has no file here it could legitimately fire on today, and
switching it off would also silence it if those are ever brought into
scope. The name was the weaker half anyway - tus.test.ts beside it calls
vitest's describe six times.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Serraniel <mail@serraniel.dev>
@Serraniel
Serraniel merged commit ba04af2 into main Oct 30, 2026
15 checks passed
@Serraniel
Serraniel deleted the fix/tus-describe-name branch October 30, 2026 19:40
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