What this thread does
Do first: Update Biome separately from nursery-rule adoption, and review unsafe fixes before changing array behavior.
What changed
- Biome 2.6.3, released 2026-10-24 (both checked 2026-10-28), adds nursery rules including
noArraySortForMinMax; it also repairs formatter cases that could change Markdown structure or produce invalid code. Full release notes. - The default reporter now sends its summary, skipped-fixes notice and
--max-diagnosticswarning to stderr. Scripts reading only stdout need review. Reporter change (checked 2026-10-28).
How to migrate
1. Update the existing @biomejs/biome dependency to 2.6.3 (checked 2026-10-28) with your package manager and inspect the lockfile. Keep rule changes in a separate diff. 2. Run the installed CLI's documented biome lint ./src command through your usual package-manager script, without write flags. CLI reference. 3. If you want this rule, merge the following into biome.json; preserve your other settings. This is the official rule page's explicit opt-in configuration:
{
"linter": {
"rules": {
"nursery": {
"noArraySortForMinMax": "error"
}
}
}
}
4. Review each suggested replacement. The rule proposes Math.min(...array) or Math.max(...array) when sorting is used only to read an extremum. Its fix is unsafe: confirm empty-array behavior, mutation requirements, NaN, sparse arrays and size before accepting it. Rule reference. 5. Review any wrapper that captures CLI stdout. The reporter's moved summary does not imply diagnostics disappeared.
The problem
A patch upgrade and enabling new experimental rules can create different review work, especially when an agent applies every suggested fix.
What breaks
Nursery rules require explicit opt-in on stable releases and can change outside normal semantic-version guarantees. Installing the patch alone does not require enabling them.
Diagnostic: This sorts the whole array only to read its smallest value.
The official example emits lint/nursery/noArraySortForMinMax for array.sort((a, b) => a - b)[0]. The proposed change can replace undefined from an empty array with Infinity; it also removes the original sort's mutation. This is a review decision, not a universally equivalent rewrite.
What to test
Suggested acceptance checks, not measured results:
- Add empty, single-item, NaN-containing and sparse inputs to the affected helper's tests; check whether callers rely on mutation.
- Run your existing formatter check and inspect Markdown list and blockquote rendering.
- Verify wrappers still display stderr and retain the CLI's exit status.
Pitfalls
--write applies safe lint fixes; adding --unsafe permits unsafe ones. Do not add that flag merely to silence the new rule. Avoid enabling an entire experimental group just to try one rule. CLI flags.
Community evidence
stavros-k's issue #12524 reports a removed paragraph/list blank line; kvz's issue #12507 reports lost blockquote markers. Both carry confirmed-bug labels, and the release notes link the corresponding fixes. These reports support testing formatter output; they do not validate the new array rule's fixes in your application.
A prompt to give your agent
Your training data predates this patch. Read <https://github.com/biomejs/biome/releases/tag/%40biomejs/biome%402.6.3> and <https://biomejs.dev/linter/rules/no-array-sort-for-min-max/javascript/> first. Separate the dependency upgrade from nursery opt-in. Show proposed changes without applying unsafe fixes. Explain empty arrays, mutation, NaN, sparse arrays and spread limits for each affected helper. Check reporter stream assumptions. Label untested proposals as Untested experiment.
Limits
No CLI, formatter or application tests were run. The two user reports concern formatter bugs; independent evidence for the new nursery rule is thin. No performance improvement is measured here.
Started from a post by @biomejs, packaged by the editor. Original post