chore(deps): take Biome 2, with the migration corrected by hand and pinned - #7
Merged
Conversation
…inned
Raise @biomejs/biome from ^1.9.0 to ^2.5.6, discharging D-021's second
deferred obligation. Recorded as D-023.
The migration is NOT taken as `biome migrate` produced it. On the v1
config it rewrites
"rules": { "recommended": true } -> "rules": { "preset": "none" }
which does not port the rule set, it deletes it. Verified by planting
rather than by reading the output: a file containing any, == and an
unused var draws zero diagnostics under the migrated config and three
(noExplicitAny, noDoubleEquals, noUnusedVariables) once preset is
corrected to "recommended". `biome check .` exits 0 in the broken state,
so nothing about the symptom points at the cause.
test/lint-gate.test.ts now pins the corrected config: it asserts the
preset is "recommended" and that the transport-isolation override is
still error for aedes/aedes-server-factory under **/src/** and off under
**/src/broker/**. Negative control verified - setting preset back to
"none" makes it exit 1. It carries no R-### tag, following
test/import-style.test.ts (D-013): it pins a decision, not a requirement.
The transport-isolation rule survives the group move out of nursery into
style, re-verified by hand: exit 1 on an aedes import outside src/broker/,
exit 0 on the same file inside it.
34 findings on the existing tree, all resolved:
- 17 assist/source/organizeImports (named-import sorting, auto-fixed)
- 14 correctness/noUnsafeOptionalChaining
- 2 complexity/useOptionalChain
- 1 correctness/noUnusedFunctionParameters
- 1 complexity/noUselessEscapeInRegex
One of Biome's "safe" fixes was not safe. noUselessEscapeInRegex rewrote
MQTT_EXTENSION_KEY from /^x-[\w\d\.\x2d_]+$/ to /^x-[\w\d.\x2d_]+$/. That
is a no-op to the regex engine and a real defect here: D-019 transcribes
that pattern character-for-character from the upstream @asyncapi/specs
schema key, and test/upstream-drift.test.ts compares .source byte-for-byte
against it. The full suite caught it (1 fail, 431 pass); the fix is
reverted and the rule suppressed inline with that reason so a future
--write cannot silently re-apply it.
The 14 noUnsafeOptionalChaining sites were all the same defect: (x?.y as
T).z, a ?. guard immediately dereferenced, so an absent value produced a
TypeError instead of a clean assertion diff. Fixed by continuing the chain
through the cast, (x?.y as T | undefined)?.z, chosen over a non-null
assertion because that spelling is clean under both tsc and Biome while
x!.y trips style/noNonNullAssertion. Both were probed before picking.
createServer(config, caps) in src/control-plane/index.ts has a genuinely
unused first parameter. It is underscored to _config rather than removed,
because dropping it changes an exported function's arity, which is a
refactor and not part of a dependency bump. Left as an optional follow-up.
Gates: check-docs, lint, typecheck, demo-app:build and full bun test all
exit 0.
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.
Raises
@biomejs/biomefrom^1.9.0to^2.5.6, discharging D-021's second deferred obligation. Recorded as D-023. This was the one deferred item that genuinely needed its own PR, and the reason is below.biome migrateproduced itOn the v1 config,
biome migraterewriteswhich does not port the rule set, it deletes it.
Verified by planting a violation rather than by reading the command's output: a file containing
any,==and an unusedvardraws zero diagnostics under the migrated config, and three (noExplicitAny,noDoubleEquals,noUnusedVariables) oncepresetis corrected to"recommended".The failure mode is the dangerous kind.
biome check .exits 0 in the broken state, CI stays green, and the repo lints nothing. Nothing about the symptom points at the cause.So the corrected config is pinned by a test
test/lint-gate.test.tsasserts the preset is"recommended"and that the transport-isolation override is stillerrorforaedes/aedes-server-factoryunder**/src/**andoffunder**/src/broker/**. Its negative control is verified: settingpresetback to"none"makes it exit 1.It carries no
R-###arrow tag, followingtest/import-style.test.ts(D-013) — it pins a decision, not a requirement.It deliberately asserts config shape rather than end-to-end gate liveness. Probing liveness for real needs a violating file under
src/, which would racetest/transport-isolation.test.ts's walk of that same directory. So liveness stays a manual check (recorded in AGENTS.md) and the automated guard covers the one regression actually observed.The transport-isolation rule also survives the group move out of
nurseryintostyle, re-verified by hand: exit 1 on anaedesimport outsidesrc/broker/, exit 0 on the same file inside it. The regex gate intest/transport-isolation.test.tsremains the independent second layer — that one catches an offending import, this one catches the rule going missing.One of Biome's "safe" fixes was not safe
noUselessEscapeInRegexrewroteMQTT_EXTENSION_KEY:A no-op to the regex engine, and a real defect here. D-019 transcribes that pattern character-for-character from the upstream
@asyncapi/specsschema key, andtest/upstream-drift.test.ts:92compares.sourcebyte-for-byte against it.The full suite caught it (1 fail, 431 pass). The fix is reverted and the rule suppressed inline with that reason, so a future
--writecannot silently re-apply it. Worth internalising: the test suite caught this one, but a less-covered invariant would have slipped through, which is why--writeoutput gets read here rather than trusted.The 34 findings, all resolved
assist/source/organizeImports(named-import sorting, auto-fixed)correctness/noUnsafeOptionalChainingcomplexity/useOptionalChaincorrectness/noUnusedFunctionParameterscomplexity/noUselessEscapeInRegex(suppressed, above)The 14 optional-chaining sites were all the same defect:
(x?.y as T).z, a?.guard immediately dereferenced, so an absent value produced aTypeErrorinstead of a clean assertion diff. Fixed by continuing the chain through the cast,(x?.y as T | undefined)?.z— chosen over a non-null assertion because that spelling is clean under bothtscand Biome, whilex!.ytripsstyle/noNonNullAssertion. Both alternatives were probed before picking rather than assumed.One of those sites then failed
tsc, because the result fedtoContain, whose parameter isstring. That site extracts the value and wraps it inString()so an absent payload still fails readably as"undefined".Deliberately not done
createServer(config, caps)insrc/control-plane/index.tshas a genuinely unused first parameter. It is underscored to_configrather than removed, because dropping it changes an exported function's arity — a refactor, not part of a dependency bump. Recorded in D-023 as an optional follow-up.Gates
check-docs,lint,typecheck,demo-app:buildand fullbun testall exit 0.With this merged, the only item still open from the D-021 dependency review is
aedes1.x, which stays deferred behind R-006/R-007.