All versions since 2.4.12
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 blocktest("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 valuearr.reduce((sum, num) => sum + num, [] as number[]);// after: type parameter on the callarr.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.
2.4.13 Latest
Patch Changes
-
#9969
c5eb92bThanks @officialasishkumar! - Added the nursery rulenoUnnecessaryTemplateExpression, which disallows template literals that only contain string literal expressions. These can be replaced with a simpler string literal.For example, the following code triggers the rule:
const a = `${"hello"}`; // can be 'hello'const b = `${"prefix"}_suffix`; // can be 'prefix_suffix'const c = `${"a"}${"b"}`; // can be 'ab' -
#10037
f785e8cThanks @minseong0324! - Fixed #9810:noMisleadingReturnTypeno longer reports false positives on a getter with a matching setter in the same namespace.class Store {get status(): string {if (Math.random() > 0.5) return "loading";return "idle";}set status(v: string) {}} -
#10084
5e2f90cThanks @jiwon79! - Fixed #10034:noUselessEscapeInRegexno longer flags escapes ofClassSetReservedPunctuatorcharacters (&,!,#,%,,,:,;,<,=,>,@,`,~) insidev-flag character classes as useless. These characters are reserved as individual code points inv-mode, so the escape is required.The following pattern is now considered valid:
/[a-z\&]/v; -
#10063
c9ffa16Thanks @Netail! - Added extra rule sources from ESLint CSS.biome migrate eslintshould do a bit better detecting rules in your eslint configurations. -
#10035
946b50eThanks @Netail! - Fixed #10032: useIframeSandbox now flags if there’s no initializer value. -
#9865
68fb8d4Thanks @dyc3! - Added the new nursery ruleuseDomNodeTextContent, which preferstextContentoverinnerTextfor DOM node text access and destructuring.For example, the following snippet triggers the rule:
const foo = node.innerText; -
#10023
bd1e74fThanks @ematipico! - Added a new nursery rulenoReactNativeDeepImportsthat disallows deep imports from thereact-nativepackage. Internal paths likereact-native/Libraries/...are not part of the public API and may change between versions.For example, the following code triggers the rule:
import View from "react-native/Libraries/Components/View/View"; -
#9885
3dce737Thanks @dyc3! - Added a new nursery ruleuseDomQuerySelectorthat prefersquerySelector()andquerySelectorAll()over older DOM query methods such asgetElementById()andgetElementsByClassName(). -
#9995
4da9cafThanks @siketyan! - Fixed #9994: Biome now parses nested CSS rules correctly when declarations follow them inside embedded snippets. -
#10009
b41cc5aThanks @Jayllyz! - Fixed #10004:noComponentHookFactoriesno longer reports false positives for object methods and class methods. -
#9988
eabf54aThanks @Netail! - Tweaked the diagnostics range for useAltText, useButtonType, useHtmlLang, useIframeTitle, useValidAriaRole & useIfameSandbox to report on the opening tag instead of the full tag. -
#10043
fc65902Thanks @mujpao! - Fixed #10003: Biome no longer panics when parsing Svelte files containing{#}. -
#9815
5cc83b1Thanks @dyc3! - Added the new nursery rulenoLoopFunc. When enabled, it warns when a function declared inside a loop captures outer variables that can change across iterations. -
#9702
ef470baThanks @ryan-m-walker! - Added the nursery ruleuseRegexpTestthat enforcesRegExp.prototype.test()overString.prototype.match()andRegExp.prototype.exec()in boolean contexts.test()returns a boolean directly, avoiding unnecessary computation of match results.Invalid
if ("hello world".match(/hello/)) {}Valid
if (/hello/.test("hello world")) {} -
#9743
245307dThanks @leetdavid! - Fixed #2245: Svelte<script>tag language detection when thegenericsattribute contains>characters (e.g.,<script lang="ts" generics="T extends Record<string, unknown>">). Biome now correctly recognizes TypeScript in such script blocks. -
#10046
0707de7Thanks @Conaclos! - Fixed #10038:organizeImportsnow sorts imports in TypeScript modules and declaration files.declare module "mymodule" {import type { B } from "b";import type { A } from "a";import type { B } from "b";} -
#10012
94ccca9Thanks @ematipico! - Added the nursery rulenoReactNativeLiteralColors, which disallows color literals inside React Native styles.The rule belongs to the
reactNativedomain. It reports properties whose name containscolorand whose value is a string literal when they appear inside aStyleSheet.create(...)call or inside a JSX attribute whose name containsstyle.// Invalidconst Hello = () => <Text style={{ backgroundColor: "#FFFFFF" }}>hi</Text>;const styles = StyleSheet.create({text: { color: "red" },});// Validconst red = "#f00";const styles = StyleSheet.create({text: { color: red },}); -
#10005
131019eThanks @ematipico! - Added the nursery rulenoReactNativeRawText, which disallows raw text outside of<Text>components in React Native.The rule belongs to the new
reactNativedomain.// Invalid<View>some text</View><View>{'some text'}</View>// Valid<View><Text>some text</Text></View>Additional components can be allowlisted through the
skipoption:{"options": {"skip": ["Title"]}} -
#9911
1603f78Thanks @Netail! - Added the nursery rulenoJsxLeakedDollar, which flags text nodes with a trailing$if the next sibling node is a JSX expression. This could be an unintentional mistake, resulting in a ’$’ being rendered as text in the output.Invalid:
function MyComponent({ user }) {return <div>Hello ${user.name}</div>;} -
#9999
f42405fThanks @minseong0324! - FixednoMisleadingReturnTypeincorrectly flagging functions with reassignedletvariables. -
#10075
295f97fThanks @ematipico! - Fixed#9983: Biome now parses functions declared inside Svelte#snippetblocks without throwing errors. -
#10006
cf4c1c9Thanks @minseong0324! - Fixed #9810:noMisleadingReturnTypeincorrectly flagging nested object literals with widened properties. -
#10033
11ddc05Thanks @ematipico! - Added the nursery ruleuseReactNativePlatformComponentsthat ensures platform-specific React Native components (e.g.ProgressBarAndroid,ActivityIndicatorIOS) are only imported in files with a matching platform suffix. It also reports when Android and iOS components are mixed in the same file.The following code triggers the rule when the file does not have an
.android.jssuffix:file.js import { ProgressBarAndroid } from "react-native";
Copyright (c) 2023-present Biome Developers and Contributors.