2.4.12
Patch Changes
-
#9376
9701a33Thanks @dyc3! - Added thenursery/noIdenticalTestTitlelint rule. This rule disallows using the same title for twodescribeblocks or two test cases at the same nesting level.describe("foo", () => {}); describe("foo", () => { // invalid: same title as previous describe block test("baz", () => {}); test("baz", () => {}); // invalid: same title as previous test case });
-
#9889
7ae83f2Thanks @dyc3! - Improved the diagnostics foruseForOfto better explain the problem, why it matters, and how to fix it. -
#9916
27dd7b1Thanks @Jayllyz! - Added a new nursery rulenoComponentHookFactories, that disallows defining React components or custom hooks inside other functions.For example, the following snippets trigger the rule:
function createComponent(label) { function MyComponent() { return <div>{label}</div>; } return MyComponent; }
function Parent() { function Child() { return <div />; } return <Child />; }
-
#9980
098f1ffThanks @ematipico! - Fixed #9941: Biome now emits awarningdiagnostic when a file exceed thefiles.maxSizelimit. -
#9942
9956f1dThanks @dyc3! - Fixed #9918:useConsistentTestItno longer panics when applying fixes to chained calls such astest.for([])("x", () => {});. -
#9891
4d9ac51Thanks @dyc3! - Improved thenoGlobalObjectCallsdiagnostic to better explain why calling global objects likeMathorJSONis invalid and how to fix it. -
#9902
3f4d103Thanks @ematipico! - Fixed #9901: the commandlint --writeis now idempotent when it's run against HTML-ish files that contains scripts and styles. -
#9891
4d9ac51Thanks @dyc3! - Improved thenoMultiStrdiagnostic to explain why escaped multiline strings are discouraged and what to use instead. -
#9966
322675eThanks @siketyan! - Fixed #9113: Biome now parses and formats@mediaand other conditional blocks correctly inside embedded CSS snippets. -
#9835
f8d49d9Thanks @bmish! - ThenoFloatingPromisesrule now detects floating promises through cross-module generic wrapper functions. Previously, patterns likeexport const fn = trace(asyncFn)— wheretracepreserves the function signature via a generic<F>(fn: F): F— were invisible to the rule when the wrapper was defined in a different file. -
#9981
02bd8ddThanks @siketyan! - Fixed #9975: Biome now parses nested CSS selectors correctly inside embedded snippets without requiring an explicit&. -
#9949
e0ba71dThanks @Netail! - Added the nursery ruleuseIframeSandbox, which enforces thesandboxattribute foriframetags.Invalid:
<iframe></iframe>
-
#9913
d417803Thanks @Netail! - Added the nursery rulenoJsxNamespace, which disallows JSX namespace syntax.Invalid:
<ns:testcomponent />
-
#9892
e75d70eThanks @dyc3! - Improved thenoSelfComparediagnostic to better explain why comparing a value to itself is suspicious and what to use for NaN checks. -
#9861
2cff700Thanks @dyc3! - Added the new nursery ruleuseVarsOnTop, which requiresvardeclarations to appear at the top of their containing scope.For example, the following code now triggers the rule:
function f() { doSomething(); var value = 1; }
-
#9892
e75d70eThanks @dyc3! - Improved thenoThenPropertydiagnostic to better explain why exposingthencan create thenable behavior and how to avoid it. -
#9892
e75d70eThanks @dyc3! - Improved thenoShorthandPropertyOverridesdiagnostic to explain why later shorthand declarations can unintentionally overwrite earlier longhand properties. -
#9978
4847715Thanks @mdevils! - Fixed #9744:useExhaustiveDependenciesno longer reports false positives for variables obtained via object destructuring with computed keys, e.g.const { [KEY]: key1 } = props. -
#9892
e75d70eThanks @dyc3! - Improved thenoRootTypediagnostic to better explain that the reported root type is disallowed by project configuration and how to proceed. -
#9927
7974ab7Thanks @dyc3! - Added eslint-plugin-unicorn'sno-nested-ternaryas a rule source fornoNestedTernary -
#9873
19ff706Thanks @minseong0324! -noMisleadingReturnTypenow checks class methods, object methods, and getters in addition to functions. -
#9888
362b638Thanks @dyc3! - Updated metadata forbiome migrate eslintto better reflect which ESLint rules are redundant versus unsupported versus unimplemented. -
#9892
e75d70eThanks @dyc3! - Improved thenoAutofocusdiagnostic to better explain why autofocus harms accessibility outside allowed modal contexts. -
#9982
d6bdf4aThanks @dyc3! - Improved performance of noMagicNumbers.
Biome now maps ESLintno-magic-numberssources more accurately duringbiome migrate eslint. -
#9889
7ae83f2Thanks @dyc3! - Improved the diagnostics fornoConstantConditionto better explain the problem, why it matters, and how to fix it. -
#9866
40bd180Thanks @dyc3! - Added a new nursery rulenoExcessiveSelectorClasses, which limits how many class selectors can appear in a single CSS selector. -
#9796
f1c1363Thanks @dyc3! - Added a new nursery ruleuseStringStartsEndsWith, which prefersstartsWith()andendsWith()over verbose string prefix and suffix checks.The rule uses type information, so it only reports on strings and skips array lookups such as
items[0] === "a". -
#9942
9956f1dThanks @dyc3! - Fixed the safe fix fornoSkippedTestsso it no longer panics when rewriting skipped test function names such asxit(),xtest(), andxdescribe(). -
#9874
9e570d1Thanks @minseong0324! - Type-aware lint rules now resolve members throughPick<T, K>andOmit<T, K>utility types. -
#9909
0d0e611Thanks @Netail! - Added the nursery ruleuseReactAsyncServerFunction, which requires React server actions to be async.Invalid:
function serverFunction() { "use server"; // ... }
-
#9925
29accb3Thanks @ematipico! - Fixed #9910: added support for parsing member expressions in Svelte directive properties. Biome now correctly parses directives likein:renderer.in|global,use:obj.action, and deeply nested forms likein:a.b.c|global. -
#9904
e7775a5Thanks @ematipico! - Fixed #9626:noUnresolvedImportsno longer reports false positives for named imports from packages that have a corresponding@types/*package installed. For example,import { useState } from "react"with@types/reactinstalled is now correctly recognised. -
#9942
9956f1dThanks @dyc3! - Fixed the safe fix fornoFocusedTestsso it no longer panics when rewriting focused test function names such asfit()andfdescribe(). -
#9577
c499f46Thanks @tt-a1i! - Added the nursery ruleuseReduceTypeParameter. It flags type assertions on the initial value passed toArray#reduceandArray#reduceRightand recommends using a type parameter instead.// before: type assertion on initial value arr.reduce((sum, num) => sum + num, [] as number[]); // after: type parameter on the call arr.reduce<number[]>((sum, num) => sum + num, []);
-
#9895
1c8e1efThanks @Netail! - Added extra rule sources from react-xyz.biome migrate eslintshould do a bit better detecting rules in your eslint configurations. -
#9891
4d9ac51Thanks @dyc3! - Improved thenoInvalidUseBeforeDeclarationdiagnostic to better explain why using a declaration too early is problematic and how to fix it. -
#9889
7ae83f2Thanks @dyc3! - Improved the diagnostics fornoRedeclareto better explain the problem, why it matters, and how to fix it. -
#9875
a951586Thanks @minseong0324! - Type-aware lint rules now resolve members throughPartial<T>,Required<T>, andReadonly<T>utility types, preserving optional, readonly, and nullable member flags.
What's Changed
- fix(migrate): update some more rule metadata by @dyc3 in #9888
- chore: extra rule sources by @Netail in #9895
- fix(core): idempotent lint write by @ematipico in #9902
- chore: just a small harness to prevent markdown leaking by @ematipico in #9906
- fix(lint/js): improve diagnostics for
noConstantCondition,useForOf,noRedeclareby @dyc3 in #9889 - fix(resolver): resolution of namespace members by @ematipico in #9904
- feat(lint/js): add
noExcessiveSelectorClassesby @dyc3 in #9866 - fix(lint/js): improve diagnostics for
noSelfCompare,noThenProperty,noShorthandPropertyOverrides,noRootType,noAutofocusby @dyc3 in #9892 - fix(lint/js): improve diagnostics for
noGlobalObjectCalls,noMultiStr,noInvalidUseBeforeDeclarationby @dyc3 in #9891 - feat(lint): implement useReduceTypeParameter nursery rule by @tt-a1i in #9577
- feat(css): extend SCSS parsing with function names, interpolated values by @denbezrukov in #9837
- chore: ignore rand unsoundness advisory by @dyc3 in #9923
- feat(lint/js): add
noIdenticalTestTitleby @dyc3 in #9376 - feat(js_analyze): implement noJsxNamespace by @Netail in #9913
- fix: main release by @Netail in #9924
- feat(lint/js): add
useStringStartsEndsWithby @dyc3 in #9796 - feat(md/fmt): better formatting for some cases by @ematipico in #9917
- fix(parse/html): svelte directive member expression by @ematipico in #9925
- feat(js_analyze): implement useReactAsyncServerFunction by @Netail in #9909
- feat(react/js): add noComponentHookFactories by @Jayllyz in #9916
- chore: add rule source for noNestedTernary by @dyc3 in #9927
- refactor(conf): opt-in bpaf by @ematipico in #9920
- feat(lint): support class methods, object methods, and getters in noMisleadingReturnType by @minseong0324 in #9873
- fix(markdown_parser): paragraph with trailing hard break absorbs following blank line by @jfmcdowell in #9931
- fix(markdown_parser): mixed bullet markers and lazy continuation in lists by @jfmcdowell in #9933
- fix(useConsistentTestIt): fix panic when applying code fix by @dyc3 in #9942
- fix(markdown_parser): restore leading-space stripping after hard line breaks by @jfmcdowell in #9934
- chore(deps): update dependency @types/node to v24.12.2 by @renovate[bot] in #9954
- chore(deps): update dependency tombi to v0.9.16 by @renovate[bot] in #9955
- feat(type-info): add Partial, Required, and Readonly type synthesis by @minseong0324 in #9875
- chore(deps): update docker/dockerfile:1 docker digest to 2780b5c by @renovate[bot] in #9951
- chore(deps): update rust:1.94.1-bullseye docker digest to f4f82b8 by @renovate[bot] in #9952
- chore(deps): update rust:1.94.1-trixie docker digest to e8e2bb5 by @renovate[bot] in #9953
- chore(deps): update github-actions by @renovate[bot] in #9956
- chore(deps): update rust crate tokio to 1.51.1 by @renovate[bot] in #9957
- chore(deps): update rust crate ureq to 3.3.0 by @renovate[bot] in #9958
- refactor(core): semantic model in collector by @ematipico in #9905
- feat(type-info): add Pick and Omit type synthesis by @minseong0324 in #9874
- chore: combine attribute impl by @Netail in #9950
- ci: combine benchmark jobs back into one workflow by @dyc3 in #9963
- fix(parser/css): parse conditional block correctly inside embedded snippets by @siketyan in #9966
- feat(lint/js): add
useVarsOnTopby @dyc3 in #9861 - fix(ci): checkout repository before benchmark path filtering on push by @dyc3 in #9973
- fix(linter): detect floating promises through cross-module generic wrappers by @bmish in #9835
- feat(md/fmt): autolink, setext header by @ematipico in #9929
- fix(core): file size diagnostic severity by @ematipico in #9980
- chore(skills): common mistakes in lint rules by @dyc3 in #9972
- perf(noMagicNumbers): reduce allocations by @dyc3 in #9982
- feat: implement useIframeSandbox by @Netail in #9949
- fix(parser/css): nested selectors in embedded snippets by @siketyan in #9981
- fix(linter):
useExhaustiveDependenciesproper handling of computed keys when destructuring, fixes #9744 by @mdevils in #9978 - ci: release by @github-actions[bot] in #9890
New Contributors
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.11...@biomejs/biome@2.4.12