feat(config): upgrade Biome.js to v2.3.10 and optimize framework configs#570
feat(config): upgrade Biome.js to v2.3.10 and optimize framework configs#570
Conversation
Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
|
@copilot The upgrade report leave it on a comment or on the pull request description, remove the file please. |
Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
|
@copilot The shared rules should be only added on "extends": ["@tutods/biome-config", "@tutods/biome-config/nestjs"],It's important to have in mind that |
Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
Fixed! Removed all duplicate shared rules from nestjs.json, nextjs.json, and solidjs.json. They now only contain framework-specific overrides. (commit 0180840) Regarding NestJS-specific rules: The current configuration is already optimized for NestJS with:
Biome doesn't have additional NestJS-specific rules beyond these decorator/DI compatibility settings. |
|
@copilot Should any rule from base.json be disabled on nestjs.json or solidjs.json? |
Co-authored-by: tutods <18479474+tutods@users.noreply.github.com>
Yes, added necessary rule disables. (commit c947abc) NestJS (backend):
SolidJS:
All other base.json rules are applicable to both frameworks. |
There was a problem hiding this comment.
Pull request overview
This PR upgrades Biome.js from version 2.3.3 to 2.3.10 and refactors the configuration structure to eliminate duplication across framework-specific configs.
- Updated all schema references from 2.2.4/2.3.3 to 2.3.10
- Added 9 new lint rules to the base configuration for improved code quality and security
- Refactored framework-specific configs to contain only overrides, removing duplicate rules already present in base.json
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| configs/biome-config/base.json | Updated schema to 2.3.10 and added 9 new rules (noScriptUrl, useArraySortCompare, useAwaitThenable, useRegexpExec, noEqualsToNull, noLeakedRender, noDuplicatedSpreadProps, noAmbiguousAnchorText, noMultiStr) to the nursery section |
| configs/biome-config/nextjs.json | Updated schema to 2.3.10 and removed duplicate style rules, keeping only Next.js-specific overrides (noHeadElement in style, noImgElement in performance) |
| configs/biome-config/nestjs.json | Updated schema to 2.3.10, removed duplicate style rules, and added appropriate disables for frontend-specific rules (a11y, JSX rules) that don't apply to backend projects |
| configs/biome-config/solidjs.json | Updated schema to 2.3.10, removed duplicate style rules, and kept only SolidJS-specific overrides (noReactSpecificProps error, useHookAtTopLevel disabled) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "noScriptUrl": "error", | ||
| "useArraySortCompare": "error", | ||
| "useAwaitThenable": "error", | ||
| "useRegexpExec": "warn", | ||
| "noEqualsToNull": "error", | ||
| "noLeakedRender": "error", | ||
| "noDuplicatedSpreadProps": "error", | ||
| "noAmbiguousAnchorText": "warn", | ||
| "noMultiStr": "error" |
There was a problem hiding this comment.
Several of these rules may have graduated from the nursery category in Biome v2.3.10 and should be placed in their appropriate stable categories instead:
noScriptUrlshould likely be in the "security" categoryuseArraySortCompare,useAwaitThenable,useRegexpExec, andnoEqualsToNullshould likely be in the "suspicious" categorynoMultiStrshould likely be in the "style" categorynoAmbiguousAnchorTextshould likely be in the "a11y" category
Placing rules in the wrong category can cause configuration issues when these rules graduate from nursery. Please verify the correct category for each rule in the Biome v2.3.10 documentation and move them to their appropriate stable categories if they've graduated.
Pull request
Description
Upgraded Biome.js from 2.3.3 to 2.3.10 across all configurations. Added 9 new nursery rules from releases 2.3.4-2.3.10 and refactored configuration structure to eliminate duplicate rules and disable inapplicable rules for framework-specific contexts.
Security & Correctness
noScriptUrl- blocksjavascript:URLs (XSS prevention)noEqualsToNull- enforces strict equality for null checksuseArraySortCompare- requires compareFunction in Array#sortuseAwaitThenable- validates await usage on Promises onlyuseRegexpExec- prefers RegExp#exec over String#matchJSX & Accessibility
noLeakedRender- prevents unintended value rendering (e.g.,0)noDuplicatedSpreadProps- catches duplicate spread identifiersnoAmbiguousAnchorText- flags generic link text ("click here", etc.)Code Quality
noMultiStr- disallows escaped newline multiline stringsFixed
noBiomeFirstExceptionby removing redundant**pattern from root config (base config already provides catch-all).Updated schema references in all config files: base.json, nextjs.json, nestjs.json, solidjs.json.
Configuration Structure Changes
Refactored framework-specific configurations to follow proper extension pattern:
Removed duplicate rules from framework-specific configs since they extend base.json via:
Disabled Inapplicable Rules:
noLeakedRender,noDuplicatedSpreadProps,noUselessFragments), a11y rules (not applicable for backend APIs), and frontend-specific rules (noAmbiguousAnchorText,useSortedClasses)useHookAtTopLevel(React-specific rule that doesn't apply to Solid's reactivity model where "hooks" likecreateSignalrun once for setup, not on every render)Upgrade Details
Version Changes
Files Updated
/biome.json- Updated schema to 2.3.10, fixed noBiomeFirstException/package.json- Updated @biomejs/biome to ^2.3.10/configs/biome-config/package.json- Updated dependencies and peerDependencies/configs/biome-config/base.json- Updated schema to 2.3.10, added 9 new rules/configs/biome-config/nextjs.json- Updated schema, removed duplicate rules/configs/biome-config/nestjs.json- Updated schema, removed duplicate rules, disabled inapplicable rules/configs/biome-config/solidjs.json- Updated schema, removed duplicate rules, disabled React-specific rulesNew Rules Evaluation
All 9 rules added are from the nursery category (experimental but stable). Rules evaluated but not added:
noContinue- too opinionated for general usenoUndeclaredEnvVars- only relevant for Turborepo projectsuseRequiredScripts- project standards already establishedNestJS Configuration
Current NestJS-specific settings are optimal for backend development:
unsafeParameterDecoratorsEnabled: true- allows decorators like @Injectable, @controlleruseImportType: "off"- prevents breaking dependency injectionnoStaticOnlyClass: "off"- allows NestJS module patternsnoUselessConstructor: "off"- allows DI constructorsuseHookAtTopLevel: "off"- disabled (React-specific)Testing Results
Motivation and Context
Staying current with Biome.js releases provides access to improved security rules, better correctness checks, and enhanced developer experience. The new rules catch common bugs and security issues automatically.
Refactoring the configuration structure eliminates rule duplication and ensures consistent linting behavior across all frameworks while maintaining framework-specific overrides where needed. Disabling inapplicable rules prevents false positives and irrelevant warnings in backend and framework-specific contexts.
References
Types of changes
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.