2.3.6
Patch Changes
-
#8100
82b9a8eThanks @Netail! - Added the nursery ruleuseFind. Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.Invalid:
[1, 2, 3].filter((x) => x > 1)[0]; [1, 2, 3].filter((x) => x > 1).at(0);
-
#8118
dbc7021Thanks @hirokiokada77! - Fixed #8117:useValidLangnow accepts valid BCP 47 language tags with script subtags.Valid:
<html lang="zh-Hans-CN"></html>
-
#7672
f1d5725Thanks @Netail! - Added the nursery ruleuseConsistentGraphqlDescriptions, requiring all descriptions to follow the same style (either block or inline) inside GraphQL files.Invalid:
enum EnumValue { "this is a description" DEFAULT }
Valid:
enum EnumValue { """ this is a description """ DEFAULT }
-
#8026
f102661Thanks @matanshavit! - Fixed #8004:noParametersOnlyUsedInRecursionnow correctly detects recursion by comparing function bindings instead of just names.Previously, the rule incorrectly flagged parameters when a method had the same name as an outer function but called the outer function (not itself):
function notRecursive(arg) { return arg; } const obj = { notRecursive(arg) { return notRecursive(arg); // This calls the outer function, not the method itself }, };
Biome now properly distinguishes between these cases and will not report false positives.
-
#8097
5fc5416Thanks @dyc3! - Added the nursery rulenoVueVIfWithVFor. This rule disallowsv-forandv-ifon the same element.<!-- Invalid --> <div v-for="item in items" v-if="item.isActive"> {{ item.name }} </div>
-
#8085
7983940Thanks @Netail! - Added the nursery rulenoForIn. Disallow iterating using a for-in loop.Invalid:
for (const i in array) { console.log(i, array[i]); }
-
#8086
2b41e82Thanks @matanshavit! - Fixed #8045: ThenoNestedTernaryrule now correctly detects nested ternary expressions even when they are wrapped in parentheses (e.g.foo ? (bar ? 1 : 2) : 3).Previously, the rule would not flag nested ternaries like
foo ? (bar ? 1 : 2) : 3because the parentheses prevented detection. The rule now looks through parentheses to identify nested conditionals.Previously not detected (now flagged):
const result = foo ? (bar ? 1 : 2) : 3;
Still valid (non-nested with parentheses):
const result = foo ? bar : baz;
-
#8075
e403868Thanks @YTomm! - Fixed #7948: TheuseReadonlyClassPropertiescode fix whencheckAllPropertiesis enabled will no longer insert a newline afterreadonlyand the class property. -
#8102
47d940eThanks @lucasweng! - Fixed #8027.useReactFunctionComponentsno longer reports class components that implementcomponentDidCatchusing class expressions.The rule now correctly recognizes error boundaries defined as class expressions:
const ErrorBoundary = class extends Component { componentDidCatch(error, info) {} render() { return this.props.children; } };
-
#8097
5fc5416Thanks @dyc3! - Added the nursery ruleuseVueHyphenatedAttributes, which encourages using kebab case for attribute names, per the Vue style guide's recommendations.<!-- Invalid --> <MyComponent myProp="value" /> <!-- Valid --> <MyComponent my-prop="value" />
-
#8108
0f0a658Thanks @Netail! - Added the nursery rulenoSyncScripts. Prevent the usage of synchronous scripts.Invalid:
<script src="https://third-party-script.js" />
Valid:
<script src="https://third-party-script.js" async /> <script src="https://third-party-script.js" defer />
-
#8098
1fdcaf0Thanks @Jayllyz! - Added documentation URLs to rule descriptions in the JSON schema. -
#8097
5fc5416Thanks @dyc3! - Fixed an issue with the HTML parser where it would treat Vue directives with dynamic arguments as static arguments instead. -
#7684
f4433b3Thanks @vladimir-ivanov! - ChangednoUnusedPrivateClassMembersto align more fully with meaningful reads.This rule now distinguishes more carefully between writes and reads of private class members.
- A meaningful read is any access that affects program behavior.
- For example,
this.#x += 1both reads and writes#x, so it counts as usage. - Pure writes without a read (e.g.
this.#x = 1with no getter) are no longer treated as usage.
This change ensures that private members are only considered “used” when they are actually read in a way that influences execution.
Invalid examples (previously valid)
class UsedMember { set #x(value) { doSomething(value); } foo() { // This assignment does not actually read #x, because there is no getter. // Previously, this was considered a usage, but now it’s correctly flagged. this.#x = 1; } }
Valid example (Previously invalid)
class Foo { #usedOnlyInWriteStatement = 5; method() { // This counts as a meaningful read because we both read and write the value. this.#usedOnlyInWriteStatement += 42; } }
-
#7684
f4433b3Thanks @vladimir-ivanov! - Improved detection of used private class membersThe analysis for private class members has been improved: now the tool only considers a private member “used” if it is actually referenced in the code.
- Previously, some private members might have been reported as used even if they weren’t actually accessed.
- With this change, only members that are truly read or called in the code are counted as used.
- Members that are never accessed will now be correctly reported as unused.
This makes reports about unused private members more accurate and helps you clean up truly unused code.
Example (previously valid)
type YesNo = "yes" | "no"; export class SampleYesNo { private yes: () => void; private no: () => void; private dontKnow: () => void; // <- will now report as unused on(action: YesNo): void { this[action](); } }
-
#7681
b406db6Thanks @kedevked! - Added the new lint rule,useSpread, ported from the ESLint ruleprefer-spread.This rule enforces the use of the spread syntax (
...) overFunction.prototype.apply()when calling variadic functions, as spread syntax is generally more concise and idiomatic in modern JavaScript (ES2015+).The rule provides a safe fix.
Invalid
Math.max.apply(Math, args); foo.apply(undefined, args); obj.method.apply(obj, args);
Valid
Math.max(...args); foo(...args); obj.method(...args); // Allowed: cases where the `this` binding is intentionally changed foo.apply(otherObj, args);
-
#7287
aa55c8dThanks @ToBinio! - Fixed #7205: ThenoDuplicateTestHooksrule now treats chained describe variants (e.g., describe.each/for/todo) as proper describe scopes, eliminating false positives.The following code will no longer be a false positive:
describe("foo", () => { describe.for([])("baz", () => { beforeEach(() => {}); }); describe.todo("qux", () => { beforeEach(() => {}); }); describe.todo.each([])("baz", () => { beforeEach(() => {}); }); });
-
#8013
0c0edd4Thanks @Jayllyz! - Added the GraphQL nursery ruleuseUniqueGraphqlOperationName. This rule ensures that all GraphQL operations within a document have unique names.Invalid:
query user { user { id } } query user { user { id email } }
Valid:
query user { user { id } } query userWithEmail { user { id email } }
-
#8084
c2983f9Thanks @dyc3! - Fixed #8080: The HTML parser, when parsing Vue, can now properly handle Vue directives with no argument, modifiers, or initializer (e.g.v-else). It will no longer treat subsequent valid attributes as bogus.<p v-else class="flex">World</p> <!-- Fixed: class now gets parsed as it's own attribute -->
-
#8104
041196bThanks @Conaclos! - FixednoInvalidUseBeforeDeclaration.
The rule no longer reports a use of an ambient variable before its declarations.
The rule also completely ignores TypeScript declaration files.
The following code is no longer reported as invalid:CONSTANT; declare const CONSTANT: number;
-
#8060
ba7b076Thanks @dyc3! - Added the nursery ruleuseVueValidVBind, which enforces the validity ofv-binddirectives in Vue files.Invalid
v-bindusages include:<Foo v-bind /> <!-- Missing argument --> <Foo v-bind:foo /> <!-- Missing value --> <Foo v-bind:foo.bar="baz" /> <!-- Invalid modifier -->
-
#8113
fb8e3e7Thanks @Conaclos! - FixednoInvalidUseBeforeDeclaration.
The rule now reports invalid use of classes, enums, and TypeScript's import-equals before their declarations.The following code is now reported as invalid:
new C(); class C {}
-
#8077
0170dcbThanks @dyc3! - Added the ruleuseVueValidVElseIfto enforce validv-else-ifdirectives in Vue templates. This rule reports invalidv-else-ifdirectives with missing conditional expressions or when not preceded by av-iforv-else-ifdirective. -
#8077
0170dcbThanks @dyc3! - Added the ruleuseVueValidVElseto enforce validv-elsedirectives in Vue templates. This rule reportsv-elsedirectives that are not preceded by av-iforv-else-ifdirective. -
#8077
0170dcbThanks @dyc3! - Added the ruleuseVueValidVHtmlto enforce valid usage of thev-htmldirective in Vue templates. This rule reportsv-htmldirectives with missing expressions, unexpected arguments, or unexpected modifiers. -
#8077
0170dcbThanks @dyc3! - Added the ruleuseVueValidVIfto enforce validv-ifdirectives in Vue templates. It disallows arguments and modifiers, and ensures a value is provided. -
#8077
0170dcbThanks @dyc3! - Added the ruleuseVueValidVOnto enforce validv-ondirectives in Vue templates. This rule reports invalidv-on/ shorthand@directives with missing event names, invalid modifiers, or missing handler expressions.
What's Changed
- refactor(cli/logging): removed duplication in setup_cli_subscriber(...) by @JadKHaddad in #7531
- perf(parse/tailwind): use compact trie for lexing base names instead of linear search by @dyc3 in #7977
- feat(biome_graphql_analyze): implement
useConsistentGraphqlDescriptionsby @Netail in #7672 - fix: remove unexpected new line when adding a readonly class property by @YTomm in #8075
- feat(html/analyze): add useVueValidVBind by @dyc3 in #8060
- fix(noDuplicateTestHook): detect more test function defintions by @ToBinio in #7287
- fix(noParametersOnlyUsedInRecursion): compare bindings for recursion detection by @matanshavit in #8026
- feat(html/analyze): add
useVueValidVIf,useVueValidVElseIf,useVueValidVElse,useVueValidVOnanduseVueValidVHtmlby @dyc3 in #8077 - refactor(lint): refactor NoParametersOnlyUsedInRecursion by @matanshavit in #7970
- fix(parse/html/vue): fix modifier list parser aggressively parsing tokens it shouldn't by @dyc3 in #8084
- feat(js_analyze): implement noForIn by @Netail in #8085
- fix(noNestedTernary): detect nested ternaries wrapped in parentheses by @matanshavit in #8086
- refactor: migrate to schemars v1 by @ematipico in #8087
- feat(graphql_analyze): add
useUniqueGraphqlOperationNameby @Jayllyz in #8013 - chore: regression schemars v1 by @ematipico in #8092
- refactor(core): actions and pull diagnostics by @ematipico in #8082
- chore: enable oidc publishing by @ematipico in #8074
- chore: expose schema generation function by @ematipico in #8093
- feat: add useSpread rule by @kedevked in #7681
- chore(core): add CSS variant information to the source file by @ematipico in #8095
- feat(schema): add docs URLs to rule description by @Jayllyz in #8098
- feat(js_analyze): implement useFind by @Netail in #8100
- feat(biome_js_analyze): align no_unused_private_class_members_with_semantic_class and dynamic prop access by @vladimir-ivanov in #7684
- feat(analyze): implement
noSyncScriptsby @Netail in #8108 - fix(noInvalidUseBeforeDeclaration): don't report use before ambient var declaration by @Conaclos in #8104
- fix(noInvalidUseBeforeDeclaration): handle class, enum, import-equals by @Conaclos in #8113
- fix(useReactFunctionComponents): handle class expressions with componentDidCatch by @lucasweng in #8102
- feat(lint/vue): add
noVueVIfWithVFor,useVueHyphenatedAttributesby @dyc3 in #8097 - chore(deps): update github-actions by @renovate[bot] in #8121
- chore(deps): update dependency @types/node to v22.19.1 by @renovate[bot] in #8122
- chore(deps): update dependency rust to v1.91.1 by @renovate[bot] in #8123
- chore(deps): update taiki-e/install-action action to v2.62.52 by @renovate[bot] in #8126
- chore(deps): update typescript-eslint monorepo to v8.46.4 by @renovate[bot] in #8127
- fix(biome_js_analyze): fix useValidLang rejecting BCP 47 language tags with script subtags by @hirokiokada77 in #8118
- fix(deps): update @biomejs packages by @renovate[bot] in #8129
- fix(deps): update rust crates by @renovate[bot] in #8130
- chore(deps): update rust crate schemars to 1.1.0 by @renovate[bot] in #8124
- chore(deps): update rust crate windows to 0.62.2 by @renovate[bot] in #8053
- chore(deps): update @biomejs packages (major) by @renovate[bot] in #8131
- chore(deps): update dependency @types/node to v24 by @renovate[bot] in #8132
- chore: schema regression rule domains by @ematipico in #8133
- chore: disable docstrings in coderabbit by @ematipico in #8134
- ci: release by @github-actions[bot] in #8076
New Contributors
- @JadKHaddad made their first contribution in #7531
- @YTomm made their first contribution in #8075
- @ToBinio made their first contribution in #7287
- @hirokiokada77 made their first contribution in #8118
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.3.5...@biomejs/biome@2.3.6