All versions since 2.3.4
2.3.4
Patch Changes
-
#7989
4855c4aThanks @alissonlauffer! - Fixed a regression in Astro frontmatter parsing where comments inside quoted strings were incorrectly detected as actual comments. This caused the parser to prematurely terminate frontmatter parsing when encountering strings likeconst test = "//";. For example, the following Astro frontmatter now parses correctly:---const test = "// not a real comment";--- -
#7968
0b28f5fThanks @denbezrukov! - Refactored formatter to use strictTokenelement for better performance. The newTokenvariant is optimized for static, ASCII-only text (keywords, operators, punctuation) with the following constraints:- ASCII only (no Unicode characters)
- No newlines (
\n,\r) - No tab characters (
\t)
This enables faster printing and fitting logic by using bulk string operations (
push_str,len()) instead of character-by-character iteration with Unicode width calculations. -
#7941
19b8280Thanks @Conaclos! - Fixed #7943. Rules’optionsare now properly merged with the inheritedoptionsfrom a shared configuration.This means that you can now override a specific option from a rule without resetting the other options to their default.
Given the following shared configuration:
{"linter": {"rules": {"style": {"useNamingConvention": {"level": "on","options": {"strictCase": false,"conventions": [{"selector": { "kind": "variable", "scope": "global" },"formats": ["CONSTANT_CASE"]}]}}}}}}And the user configuration that extends this shared configuration:
{"extends": ["shared.json"],"linter": {"rules": {"style": {"useNamingConvention": {"level": "on","options": { "strictCase": true }}}}}}The obtained merged configuration is now as follows:
{"extends": ["shared.json"],"linter": {"rules": {"style": {"useNamingConvention": {"level": "on","options": {"strictCase": true,"conventions": [{"selector": { "kind": "variable", "scope": "global" },"formats": ["CONSTANT_CASE"]}]}}}}}} -
#7969
425963dThanks @ematipico! - Added support for the Svelte syntax{@debug}. The Biome HTML parser is now able to parse and format the blocks:{@debug foo,bar, something}{@debug foo, bar, something} -
#7986
3256f82Thanks @lisiur! - Fixed #7981. Now Biome correctly detects and parseslang='tsx'andlang='jsx'languages when used inside in.vuefiles, when.experimentalFullSupportEnabledis enabled. -
#7921
547c2daThanks @dyc3! - Fixed #7854: The CSS parser, withtailwindDirectivesenabled, will now parse@source inline("underline");. -
#7856
c9e20c3Thanks @Netail! - Added the nursery rulenoContinue. Disallowing the usage of thecontinuestatement, structured control flow statements such asifshould be used instead.Invalid:
let sum = 0,i;for (i = 0; i < 10; i++) {if (i >= 5) {continue;}sum += i;}Valid:
let sum = 0,i;for (i = 0; i < 10; i++) {if (i < 5) {sum += i;}}
2.3.5
Patch Changes
-
#8023
96f3e77Thanks @ematipico! - Added support Svelte syntax{@html}. Biome now is able to parse and format the Svelte syntax{@html}:{@html 'div'}{@html 'div'}The contents of the expressions inside the
{@html <expression>}aren’t formatted yet. -
#8058
5f68bccThanks @ematipico! - Fixed a bug where the Biome Language Server would enable its project file watcher even when no project rules were enabled.Now the watching of nested configuration files and nested ignore files is delegated to the editor, if their LSP spec supports it.
-
#8023
96f3e77Thanks @ematipico! - Added support Svelte syntax{@render}. Biome now is able to parse and format the Svelte syntax{@render}:{@render sum(1, 2) }{@render sum(1, 2)}The contents of the expressions inside the
{@render <expression>}aren’t formatted yet. -
#8006
f0612a5Thanks @Bertie690! - Updated documentation and diagnostic forlint/complexity/noBannedTypes. The rule should have a more detailed description and diagnostic error message. -
#8039
da70d8bThanks @PFiS1737! - Biome now keeps a blank line after the frontmatter section in Astro files. -
#8042
b7efa6fThanks @dyc3! - The CSS Parser, withtailwindDirectivesenabled, will now accept at rules like@mediaand@supportsin@custom-variantshorthand syntax. -
#8064
3ff9d45Thanks @dibashthapa! - Fixed #7967: Fixed the issue with support for advanced SVG props -
#8023
96f3e77Thanks @ematipico! - Added support Svelte syntax{@attach}. Biome now is able to parse and format the Svelte syntax{@attach}:<div {@attach myAttachment }>...</div><div {@attach myAttachment}>...</div>The contents of the expressions inside the
{@attach <expression>}aren’t formatted yet. -
#8001
6e8a50eThanks @ematipico! - Added support Svelte syntax{#key}. Biome now is able to parse and format the Svelte syntax{#key}:{#key expression} <div></div> {/key}{#key expression}<div></div>{/key}The contents of the expressions inside the
{#key <expression>}aren’t formatted yet. -
#8023
96f3e77Thanks @ematipico! - Added support Svelte syntax{@const}. Biome now is able to parse and format the Svelte syntax{@const}:{@const name = value}{@const name = value}The contents of the expressions inside the
{@const <expression>}aren’t formatted yet. -
#8044
8f77d4aThanks @Netail! - Corrected rule source references.biome migrate eslintshould do a bit better detecting rules in your eslint configurations. -
#8065
1a2d1afThanks @Netail! - Added the nursery ruleuseArraySortCompare. Require Array#sort and Array#toSorted calls to always provide a compareFunction.Invalid:
const array = [];array.sort();Valid:
const array = [];array.sort((a, b) => a - b); -
#7673
a3a713dThanks @dyc3! - The HTML parser is now able to parse vue directives. This enables us to write/port Vue lint rules that require inspecting the<template>section. However, this more complex parsing may result in parsing errors where there was none before. For those of you that have opted in to the experimental support (akaexperimentalFullSupportEnabled), we greatly appreciate your help testing this out, and your bug reports. -
#8031
fa6798aThanks @ematipico! - Added support for the Svelte syntax{#if}{/if}. The Biome HTML parser is now able to parse and format the{#if}{/if} blocks:<!-- if / else-if / else -->{#if porridge.temperature > 100}<p>too hot!</p><p>too hot!</p>{:else if 80 > porridge.temperature}<p>too cold!</p><p>too cold!</p>{:else if 100 > porridge.temperature}<p>too too cold!</p><p>too too cold!</p>{:else}<p>just right!</p><p>just right!</p>{/if} -
#8041
beeb7bbThanks @dyc3! - The CSS parser, withtailwindDirectivesenabled, will now accept lists of selectors in@custom-variantshorthand syntax.@custom-variant cell (th:has(&), td:has(&)); -
#8028
c09e45cThanks @fmajestic! - The GitLab reporter now outputs format errors. -
#8037
78011b1Thanks @PFiS1737! -indentScriptAndStyleno longer indents the frontmatter in Astro files. -
#8009
6374b1fThanks @tmcw! - Fixed an edge case in theuseArrowFunctionrule.The rule no longer emits diagnostics for or offers to fix functions that reference the arguments object, because that object is undefined for arrow functions.
Valid example:
// Valid: this function cannot be transformed into an arrow function because// arguments is not defined for arrow functions.const getFirstArg = function () {return arguments[0];};
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 unusedon(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 changedfoo.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 {idemail}}Valid:
query user {user {id}}query userWithEmail {user {idemail}} -
#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.
2.3.7 Latest
Patch Changes
-
#8169
7fdcec8Thanks @arendjr! - Fixed #7999: Correctly placeawaitafter leading comment in auto-fix action fromnoFloatingPromisesrule. -
#8157
12d5b42Thanks @Conaclos! - Fixed #8148.noInvalidUseBeforeDeclarationno longer reports some valid use before declarations.The following code is no longer reported as invalid:
class classA {C = C;}const C = 0; -
#8178
6ba4157Thanks @dyc3! - Fixed #8174, where the HTML parser would parse 2 directives as a single directive because it would not reject whitespace in Vue directives. This would cause the formatter to erroneously merge the 2 directives into one, resulting in broken code.<Component v-else:property="123" /><Component v-else :property="123" /> -
#8088
0eb08e8Thanks @db295! - Fixed #7876: ThenoUnusedImportsrule now ignores imports that are used by @linkcode and @linkplain (previously supported @link and @see).The following code will no longer be a false positive:
import type { a } from "a"/*** {@linkcode a}*/function func() {} -
#8119
8d64655Thanks @ematipico! - Improved the detection of the rulenoUnnecessaryConditions. Now the rule isn’t triggered for variables that are mutated inside a module.This logic deviates from the original rule, hence
noUnnecessaryConditionsis now marked as “inspired”.In the following example,
heystarts asfalse, but then it’s assigned to a string. The rule isn’t triggered inside theifcheck.let hey = false;function test() {hey = "string";}if (hey) {} -
#8149
e0a02bfThanks @Netail! - Fixed #8144: ImprovenoSyncScripts, ignore script tags withtype="module"as these are always non-blocking. -
#8182
e9f068eThanks @hirokiokada77! - Fixed #7877: Range suppressions now handle suppressed categories properly.Valid:
// biome-ignore-start lint: explanationconst foo = 1;// biome-ignore-end lint: explanation -
#8111
bf1a836Thanks @ryan-m-walker! - Added support for parsing and formatting the CSS if function.Example
.basic-style {color: if(style(--scheme: dark): #eeeeee; else: #000000;);} -
#8173
7fc07c1Thanks @ematipico! - Fixed #8138 by reverting an internal refactor that caused a regression to the rulenoUnusedPrivateClassMembers. -
#8119
8d64655Thanks @ematipico! - Improved the type inference engine, by resolving types for variables that are assigned to multiple values. -
#8158
fb1458bThanks @dyc3! - Added theuseVueValidVTextlint rule to enforce validv-textdirectives. The rule reports whenv-texthas an argument, has modifiers, or is missing a value.Invalid:
<div v-text /><!-- missing value --><div v-text:aaa="foo" /><!-- has argument --><div v-text.bbb="foo" /><!-- has modifier --> -
#8158
fb1458bThanks @dyc3! - FixeduseVueValidVHtmlso that it will now flag empty strings, e.g.v-html="" -
#7078
bb7a15cThanks @emilyinure! - Fixed #6675: Now only flags noAccumulatingSpread on Object.assign when a new object is being allocated on each iteration. Before, all cases using Object.assign with reduce parameters were warned despite not making new allocations.The following code will no longer be a false positive:
foo.reduce((acc, bar) => Object.assign(acc, bar), {});The following cases which do make new allocations will continue to warn:
foo.reduce((acc, bar) => Object.assign({}, acc, bar), {}); -
#8175
0c8349eThanks @ryan-m-walker! - Fixed CSS formatting of dimension units to use correct casing forQ,HzandkHz.Before:
.cssUnits {a: 1Q;b: 1Hz;c: 1kHz;}After:
.cssUnits {a: 1Q;b: 1Hz;c: 1kHz;}
Copyright (c) 2023-present Biome Developers and Contributors.