Repository navigation
Rename the tus response helper so a new Biome rule stops matching it - #339
Merged
Merged
Conversation
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>
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.
#337bumps 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 runsnpm run lintfirst, and that is what exits 1.What the new version objects to
Four times, same line shape.
describeatsrc/lib/tus.ts:95is a module-private helper that turns a failedResponseinto a human-readable message. Biome 2.6 promotesusePlaywrightValidDescribeCallbackinto the recommended set, and the rule matches any call nameddescribe— it does not check that Playwright is imported, or that the name resolves to a local declaration eight lines up.tus.tsimports 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:main)The warning (
noUnusedImportsintheme.test.ts) and the info (noUselessConstructorintus.test.ts) are pre-existing onmainand non-blocking under both.Why a rename and not an exemption
biome.jsonsetsfiles.includesto["src/**/*.ts", "*.json"]. The Playwright specs live inweb/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 momente2ecomes into scope.The name was the weaker half of the conflict anyway:
tus.test.ts, immediately beside it, calls vitest'sdescribesix 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:
Zero errors on 2.6.2 and on 2.5.15 — identical to the baseline, so this lands safely on
mainahead of the bump.npm run lintexits 0,svelte-checkreports416 FILES 0 ERRORS 0 WARNINGS, the unit suite passes, andtus.tsholds 100% statement coverage.After this merges
Rebase
#337and it should go green on its own. Nothing else in that PR touches our code.Left alone deliberately
biome.jsondeclares"$schema": ".../2.4.1/schema.json"whilepackage.jsonpins 2.5.15 — stale, and #337 would make it staler. Not fixed here: Dependabot does not editbiome.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": trueis 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