All versions since 2.4.10
2.4.10
Patch Changes
-
#8838
f3a6a6bThanks @baeseokjae! - Added new lint nursery rulenoImpliedEval.The rule detects implied
eval()usage through functions likesetTimeout,setInterval, andsetImmediatewhen called with string arguments.// InvalidsetTimeout("alert('Hello');", 100);// ValidsetTimeout(() => alert("Hello"), 100); -
#9320
93c3b6cThanks @taberoajorge! - Fixed #7664:noUnusedVariablesno longer reports false positives for TypeScript namespace declarations that participate in declaration merging with an exported or used value declaration (const,function, orclass) of the same name. The reverse direction is also handled: a value declaration merged with an exported namespace is no longer flagged. -
#9630
1dd4a56Thanks @raashish1601! - Fixed #9629:noNegationElsenow keeps ternary branch comments attached to the correct branch when applying its fixer. -
#9216
04243b0Thanks @FrederickStempfle! - Fixed #9061:noProcessEnvnow also detectsprocess.envwhenprocessis imported from the"process"or"node:process"modules.Previously, only the global
processobject was flagged:import process from "node:process";// This was not flagged, but now it is:console.log(process.env.NODE_ENV); -
#9692
61b7ec5Thanks @mkosei! - Fixed Svelte#eachdestructuring parsing and formatting for nested patterns such as[key, { a, b }]. -
#9627
06a0f35Thanks @ematipico! - Fixed #191: Improved the performance of how the Biome Language Server pulls code actions and diagnostics.Before, code actions were pulled and computed all at once in one request. This approach couldn’t work in big files, and caused Biome to stale and have CPU usage spikes up to 100%.
Now, code actions are pulled and computed lazily, and Biome won’t choke anymore in big files.
-
#9643
5bfee36Thanks @dyc3! - Fixed #9347:useVueValidVBindno longer reports valid object bindings likev-bind="props". -
#9627
06a0f35Thanks @ematipico! - Fixed assist diagnostics being invisible when using--diagnostic-level=error. Enforced assist violations (e.g.useSortedKeys) were filtered out before being promoted to errors, causingbiome checkto incorrectly return success. -
#9695
9856a87Thanks @dyc3! - Added the new nursery rulenoUnsafePlusOperands, which reports+and+=operations that use object-like,symbol,unknown, orneveroperands, or that mixnumberwithbigint. -
#9627
06a0f35Thanks @ematipico! - Fixed duplicate parse errors incheckandcioutput. When a file had syntax errors, the same parse error was printed twice and the error count was inflated. -
#9627
06a0f35Thanks @ematipico! - Improved the performance of the commandslintandcheckwhen they are called with--write. -
#9627
06a0f35Thanks @ematipico! - Fixed--diagnostic-levelnot fully filtering diagnostics. Setting--diagnostic-level=errornow correctly excludes warnings and infos from both the output and the summary counts. -
#9623
13b3261Thanks @ematipico! - Fixed #9258:--skipno longer causessuppressions/unusedwarnings for suppression comments targeting skipped rules or domains. -
#9631
599dd04Thanks @raashish1601! - Fixed #9625:experimentalEmbeddedSnippetsEnabledno longer crashes when a file mixes formatable CSS-in-JS templates with tagged templates that the embedded formatter can’t currently delegate, such as a styled-components interpolation returning `css```.
2.4.11
Patch Changes
-
#9350
4af4a3aThanks @dyc3! - Added the new nursery rule useConsistentTestIt in thetestdomain. The rule enforces consistent use of eitheritortestfor test functions in Jest/Vitest suites, with separate control for top-level tests and tests insidedescribeblocks.Invalid:
test("should fly", () => {}); // Top-level test using 'test' flagged, convert to 'it'describe("pig", () => {test("should fly", () => {}); // Test inside 'describe' using 'test' flagged, convert to 'it'}); -
#9429
a2f3f7eThanks @ematipico! - Added the new nursery lint ruleuseExplicitReturnType. It reports TypeScript functions and methods that omit an explicit return type.function toString(x: any) {// rule triggered, it doesn't declare a return typereturn x.toString();} -
#9828
9e40844Thanks @ematipico! - Fixed #9484: the formatter no longer panics when formatting files that containgraphqltagged template literals combined with parenthesized expressions. -
#9886
e7c681eThanks @ematipico! - Fixed an issue where, occasionally, some bindings and references were not properly tracked, causing false positives fromnoUnusedVariablesandnoUndeclaredVariablesin Svelte, Vue, and Astro files. -
#9760
5b16d18Thanks @myx0m0p! - Fixed #4093: thenoDeleterule no longer triggers fordelete process.env.FOO, sincedeleteis the documented way to remove environment variables in Node.js. -
#9799
2af8efdThanks @minseong0324! - Added the rulenoMisleadingReturnType. The rule detects when a function’s return type annotation is wider than what the implementation actually returns.// Flagged: `: string` is wider than `"loading" | "idle"`function getStatus(b: boolean): string {if (b) return "loading";return "idle";} -
#9880
7f67749Thanks @dyc3! - Improved the diagnostics foruseFindto better explain the problem, why it matters, and how to fix it. -
#9755
bff7bdbThanks @ematipico! - Improved performance of fix-all operations (--write). Biome is now smarter when it runs lint rules and assist actions. First, it runs only rules that have code fixes, and then runs the rest of the rules. -
#8651
aafca2dThanks @siketyan! - Add a new lint ruleuseDisposablesfor JavaScript, which detects disposable objects assigned to variables withoutusingorawait usingsyntax. Disposable objects that implement theDisposableorAsyncDisposableinterface are intended to be disposed of after use. Not disposing them can lead to resource or memory leaks, depending on the implementation.Invalid:
function createDisposable(): Disposable {return {[Symbol.dispose]() {// do something},};}const disposable = createDisposable();Valid:
function createDisposable(): Disposable {return {[Symbol.dispose]() {// do something},};}using disposable = createDisposable(); -
#9788
53b8e57Thanks @MeGaNeKoS! - Fixed #7760: Added support for CSS scroll-driven animationtimeline-range-namekeyframe selectors (cover,contain,entry,exit,entry-crossing,exit-crossing). Biome no longer reports parse errors on keyframes likeentry 0% { ... }orexit 100% { ... }. -
#9728
5085424Thanks @mkosei! - Fixed #9696: Astro frontmatter now correctly parses regular expression literals like/\d{4}/. -
#9261
16b6c49Thanks @ematipico! - Fixed #8409: CSS formatter now correctly places comments after the colon in property declarations.Previously, comments that appeared after the colon in CSS property values were incorrectly moved before the property name:
[lang]:lang(ja) {/* system-ui,*/ font-family:font-family: /* system-ui,*/Hiragino Sans,sans-serif;} -
#9441
957ea4cThanks @soconnor-seeq! - Fixed #1630: LSP project selection now prefers the most specific project root in nested workspaces. -
#9878
de6210fThanks @ematipico! - Fixed #9118:noUnusedImportsno longer reports false positives for default imports used inside Svelte, Vue and Astro components. -
#9879
ce7e2b7Thanks @dyc3! - Fixed a parser diagnostic’s message when vue syntax is disabled so that it no longer references the non-existanthtml.parser.vueoption. This option will become available in 2.5. -
#9880
7f67749Thanks @dyc3! - Improved the diagnostics foruseRegexpExecto better explain the problem, why it matters, and how to fix it. -
#9846
b7134d9Thanks @ematipico! - Fixed #9140: Biome now parses Astro’s attribute shorthand inside.astrofiles. The following snippet no longer reports a parse error:---const items = ['a', 'b'];---<ul>{items.map((item) => <li {item}>row</li>)}</ul> -
#9790
67df09dThanks @dyc3! - Fixed #9781: Trailing comments after a top-levelbiome-ignore-all formatsuppression are now preserved instead of being dropped. This applies to JavaScript, CSS, HTML, JSONC, GraphQL, and Grit files. -
#9745
d87073eThanks @ematipico! - Fixed #9741: the LSP server now correctly returns theorganizeImportscode action when the client requests it viasource.organizeImports.biomein theonlyfilter. Previously, editors withcodeAction/resolvesupport (e.g. Zed) received an empty response because the action was serialized with the wrong kind (source.biome.organizeImportsinstead ofsource.organizeImports.biome). -
#9880
7f67749Thanks @dyc3! - Improved the diagnostics foruseArraySometo better explain the problem, why it matters, and how to fix it. -
#9795
1d09f0fThanks @dyc3! - RelaxeduseExplicitTypefor trivially inferrable types.Type annotations can now be omitted when types are trivially inferrable from:
- Binary expressions (
const sum = 1 + 1) - Comparison expressions (
const isEqual = 'a' === 'b',const isTest = process.env.NODE_ENV === 'test') - Logical expressions (
const and = true && false) - Class instantiation (
const date = new Date()) - Array literals (
const arr = [1, 2, 3]) - Conditional expressions (
const val = true ? 'yes' : 'no') - Function calls (
const num = Math.random()) - Parameter defaults - any expression is now allowed (
const fn = (max = MAX_ATTEMPTS) => ...)
Comparison expressions always return
boolean, so any operands are now allowed (including property access likeprocess.env.NODE_ENV).Parameters with default values no longer require type annotations, as TypeScript can infer the type from the default value (even when referencing variables).
Also removed the redundant
anytype validation from this rule. Theanytype is now only validated by the dedicatednoExplicitAnyrule, following the Single Responsibility Principle. - Binary expressions (
-
#9809
e8cad58Thanks @Netail! - Added the new nursery ruleuseQwikLoaderLocation, which enforces that Qwik loader functions are declared in the correct location. -
#9877
fc9d715Thanks @ematipico! - Fixed #9136 and #9653:noUndeclaredVariablesandnoUnusedVariablesno longer report false positives on several Svelte template constructs that declare or reference bindings in the host grammar:{#snippet name(params)}— the snippet name and its parameters (including object, array, rest, and nested destructuring) are now tracked.{@render name(args)}— the snippet name used at the render site is now resolved against the snippet declaration.{#each items as item, index (key)}— theitembinding (plain identifier or destructured), the optionalindex, and the optionalkeyexpression are now tracked.{@const name = value}— the declared name is now tracked as a binding and the initializer is analyzed for undeclared references.{@debug a, b, c}— each debugged identifier is now analyzed and reported if undeclared.- Shorthand attributes
<img {src} />— the curly-shorthand attribute is now analyzed as an expression, so undeclared references inside it are reported.
For example, the following template no longer triggers either rule:
<script>let items = [];let total = 0;</script>{#snippet figure(image)}<figure><img src={image.src} alt={image.caption} /><figcaption>{image.caption}</figcaption></figure>{/snippet}{#each items as item}{@const price = item.price}{@render figure(item)}<span>{price}</span>{/each}{@debug items, total} -
#9869
78bce77Thanks @Netail! - UpdatednoDuplicateFieldDefinitionNamesto also flag duplicate fields within type extensions, interface extensions & input extensions. -
#9739
0bc2198Thanks @dyc3! - Fixed Grit queries that use native Biome AST node names with the native field names that are in our.ungramgrammar files. Queries such asJsConditionalExpression(consequent = $cons, alternate = $alt)now compile successfully inbiome searchand grit plugins. -
#9811
2dddca3Thanks @dyc3! - UpdatednoImpliedEvalto flagnew Function()usages, as its a form of indirecteval, and to includeno-new-funcas a rule source. -
#9870
ccf9770Thanks @Netail! - Marked eslint-qwik-plugin’sunused-serveras redundant since it was covered bynoUnusedVariables. -
#9701
1417c3bThanks @dyc3! - Added the new nursery rulenoUselessTypeConversion, which reports redundant primitive conversion patterns such asString(value)whenvalueis already a string. -
#9248
49f00a3Thanks @pkallos! -useNullishCoalescingnow also detects ternary expressions that check fornullorundefinedand suggests rewriting them with??. A newignoreTernaryTestsoption allows disabling this behavior. -
#9863
6a44619Thanks @ematipico! - Fixed #9690:biome check --writeis now idempotent on HTML files that contain embedded<style>or<script>blocks. Previously, each run reported “Fixed 1 file” even when the file content did not actually change, because the embedded language formatter’s output was not re-indented to match the surrounding HTML block.
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
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";
2.4.14 Latest
Patch Changes
-
#9393
491b171Thanks @dyc3! - Added the nursery ruleuseTestHooksOnTopin thetestdomain. The rule flags lifecycle hooks (beforeEach,beforeAll,afterEach,afterAll) that appear after test cases in the same block, enforcing that hooks are defined before any test case. -
#10157
eefc5abThanks @dyc3! - Fixed #7882: The HTML parser will now emit better diagnostics when it encounters a void element with a closing tag, such as<br></br>. Previously, the parser would emit multiple diagnostics with conflicting advice. Now it emits a single diagnostic that clearly states that void elements should not have closing tags. -
#10054
0e9f569Thanks @minseong0324! -noMisleadingReturnTypeno longer misses widening from concrete object types, class instances, object literals, tuples, functions, and regular expressions to: object.A function annotated
: objectreturning an object literal:function f(): object {return { retry: true };} -
#10116
53269ebThanks @jiwon79! - Fixed #6201:noUselessEscapeInRegexno longer flags an escaped backslash followed by-as a useless escape. Patterns like/[\\-]/are now considered valid because the second\is the escaped backslash, not an unnecessary escape of the trailing dash. -
#10092
33d8543Thanks @Conaclos! - Fixed #9097:organizeImportsno longer adds a blank line between a never-matched group and a matched group.Given the following
organizeImportsoptions:{"groups": [":NODE:", ":BLANK_LINE:", ":PACKAGE:", ":BLANK_LINE:", ":PATH:"]}The following code…
// Commentimport "package";import "./file.js";…was organized as:
// Commentimport "package";import "./file.js";A blank line was added even though the group ‘:NODE:’ doesn’t match any imports here.
:BLANK_LINE:between never-matched groups and matched groups are now ignored. The code is now organized as:// Commentimport "package";import "./file.js"; -
#10138
a10b6c1Thanks @dyc3! - Fixed Vuev-forhandling fornoUndeclaredVariablesandnoUnusedVariables. Biome now recognizes variables declared byv-fordirectives and references to iterated values in Vue templates. -
#10115
d428d76Thanks @minseong0324! -noMisleadingReturnTypeno longer reports false positives when a union return type’sbooleanvariant is covered by bothtrueandfalsereturns. -
#9922
7acf1e0Thanks @dyc3! - Added the new nursery rulenoReactStringRefs, which disallows legacy React string refs such asref="hello"andthis.refs.hello.Biome also reports template-literal refs such as
ref={`hello`}, so React code can consistently migrate to callback refs,createRef(), oruseRef(). -
#10010
f3e76abThanks @dyc3! - Fixed a bug in the LSP file watcher registration so Biome now watches.biome.jsonand.biome.jsoncconfiguration files and reloads workspace settings when they change. -
#10176
8a40ef8Thanks @dyc3! - Fixed #10011: ThenoThisInStaticrule no longer reportsthiswhen it is used as the constructor target innew this(...), which is required for inherited static factory methods. -
#10163
6867e96Thanks @jiwon79! - Fixed #9884: TheuseSortedAttributesauto-fix no longer corrupts source code when both an outer JSX element and a nested JSX-valued attribute have unsorted attributes in the same pass. Multiple unsorted groups separated by spread or shorthand attributes within the same JSX element are now reported as a single diagnostic. -
#10079
d29dd19Thanks @Damix48! - Fixed false positive innoAssignInExpressionsfor Svelte{@const}blocks. Assignments in{@const name = value}are now correctly recognized as declarations rather than accidental assignments in expressions. -
#10080
5d8fdacThanks @Damix48! - Fixed parsing of closing parentheses in Svelte{#each}block key expressions. Biome now correctly parses method calls and other parenthesised expressions used as keys.For example, the following snippets are now parsed correctly:
{#each numbers as number, index (number.toString())}<p>{number}</p>{/each}{#each numbers as number (key(number))}<p>{number}</p>{/each} -
#10140
e7024b9Thanks @solithcy! - Fixed #10135: Biome no longer crashes on missing Svelte template expressions.The following code snippet longer panics:
{#if }<p>^ this would previously crash</p>{/if}{@const }<p> ^ this would also crash</p> -
#10111
7818009Thanks @jiwon79! - Fixed #9997:noDuplicateSelectorsno longer reports false positives for selectors inside@scopequeries. Biome now treats@scopeas a separate at-rule context, like@media,@supports,@container, and@starting-style.The following snippet is no longer flagged as a duplicate:
.Example {padding: 0;}@scope (.theme-dark) {.Example {color: white;}} -
#9926
d62b331Thanks @dyc3! - Added the nursery lint ruleuseMathMinMax, which prefersMath.min()andMath.max()over equivalent ternary comparisons.For example, this code:
const min = a < b ? a : b;is much more readable when rewritten as:
const min = Math.min(a, b); -
#10115
d428d76Thanks @minseong0324! -useExhaustiveSwitchCasesnow flags missingtrue/falsecases forbooleandiscriminants, including whenbooleanis a union variant. -
#10125
a55a0b6Thanks @bmish! - Fixed a resolver bug where packages that define a typed entry point throughpackage.json’smainfield but omittypeswere ignored during type-aware resolution. Type-aware rules such asnoFloatingPromisescan now inspect imports from those packages. -
#10117
895e809Thanks @denizdogan! - Added support for thecorner-shapefamily of CSS properties and thesuperellipse()/squircle()value functions, sonoUnknownPropertyandnoUnknownFunctionno longer flag them as unknown.New known properties:
corner-shape,corner-block-end-shape,corner-block-start-shape,corner-bottom-left-shape,corner-bottom-right-shape,corner-bottom-shape,corner-end-end-shape,corner-end-start-shape,corner-inline-end-shape,corner-inline-start-shape,corner-left-shape,corner-right-shape,corner-start-end-shape,corner-start-start-shape,corner-top-left-shape,corner-top-right-shape,corner-top-shape.New known value functions:
superellipse(),squircle(). -
#8620
8df8f73Thanks @dyc3! - Fixed #8062: Added support for parsing Vuev-fordirectives more accurately. -
#10191
aa055cdThanks @guney! - Now the rulenoStaticElementInteractionsdoesn’t trigger custom elements. -
#9757
2c62594Thanks @dyc3! - Fixed #9099: the HTML formatter collapsing non-text children (inline elements, Svelte expressions, comments) onto a single line when the source had them on separate lines. Biome now preserves the user’s intended line breaks for exclusively non-text children.For example, the following Svelte snippet is now preserved instead of being collapsed to
<div>{name}<!-- comment --></div>:<div>{name}<!-- comment --></div>Similarly, HTML elements like
<span>inside a<div>are now preserved when written on their own line:<div><span>text</span></div> -
#10105
e7c1a6dThanks @jiwon79! - Fixed #10039:useReadonlyClassPropertiesnow detects unreassigned private members in class expressions and export default classes, not only in class declarations.The following patterns are now correctly flagged:
const AnonClass = class {#prop = 123;constructor() {console.log(this.#prop);}};export default class {#prop = 123;constructor() {console.log(this.#prop);}} -
#10141
46a77d0Thanks @minseong0324! - ImprovednoUnnecessaryConditionsto detect conditions that are always truthy because they check built-in global class instances such asDate,Map,Set,WeakMap, andError. -
#10178
7b05a89Thanks @dyc3! - Fixed #10177: The HTML parser no longer reports lowercasehtmlordoctypetext as invalid after void elements such as<br>. -
#10155
0d4595dThanks @jiwon79! - Fixed #10045: the CSS formatter no longer compounds indentation inside nested functional pseudo-classes such as:not(:where(...)),:is(:where(...)), and similar combinations. The same fix also removes one level of unnecessary indentation that was added inside any pseudo-class function whose argument list wrapped onto multiple lines, including:nth-child(... of ...),::part(...), and:active-view-transition-type(...). The following snippet is now correctly formatted, matching Prettier.input:not(:where([type="submit"],[type="checkbox"],[type="radio"],[type="button"],[type="reset"])) {inline-size: 100%;} -
#10112
6f0251eThanks @dyc3! - Fixed #10110: Biome’s parser now accepts surrogate code points in JavaScript string\u{...}escapes. -
#10141
46a77d0Thanks @minseong0324! - ImprovednoMisleadingReturnTypeto detectobjectreturn annotations that hide built-in global class instances such asDate,Map,Set,WeakMap, andError. -
#10083
4a664c1Thanks @ematipico! - Added two new options tonoShadow, both defaulting totrueto match typescript-eslint’s behavior.Fixed #9482: Added
ignoreFunctionTypeParameterNameValueShadowoption. When enabled, parameter names inside function type annotations (e.g.(options: unknown) => void) are not flagged as shadowing outer variables.Fixed #7812: Added
ignoreTypeValueShadowoption. When enabled, a value binding that shares its name with a type-only declaration (type alias or interface) is not flagged, since types and values occupy separate namespaces in TypeScript. -
#9286
52695cfThanks @Hugo-Polloli! - Fixed #6316: Biome now resolves Svelte$storereferences to the underlyingstorebinding in semantic analysis, preventing falsenoUndeclaredVariablesdiagnostics when the store is declared. -
#10188
ae659ddThanks @dyc3! - Added a new nursery rulenoExcessiveNestedCallbacks, which disallows callbacks nested deeper than the configured maximum. -
#9757
2c62594Thanks @dyc3! - Fixed #9450: the HTML formatter now correctly preserves multiline formatting for nested<template>elements (e.g.<template #body>) when the source has children on separate lines. Previously, the children were collapsed onto a single line.<template><UModal><template #body> <p>content</p> </template><template #body><p>content</p></template></UModal></template> -
#10118
c6edcb4Thanks @Netail! - Fixed #10024:biome migrate eslintcorrectly migrateseslintrules that belong to multiple Biome rules.
Copyright (c) 2023-present Biome Developers and Contributors.