Skip to content

All versions since 2.6.8

2.6.8

Patch Changes

  • #13080 a68137d Thanks @dyc3! - Added the nursery rule noBufferConstructor, which disallows the deprecated Node.js Buffer() and new Buffer() constructors. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead.

    new Buffer(5);
  • #12966 82651f5 Thanks @dyc3! - Added the nursery rule noConfusingArraySplice, which reports splice() and toSpliced() calls that replace a single element or insert at index -1.

    array.splice(index, 1, element); // use `array[index] = element` instead
  • #12924 0a9d204 Thanks @dyc3! - Added the nursery rule noDynamicRequire, which disallows require() calls whose module name is built at runtime. When the checkDynamicImports option is enabled, the rule also checks import() calls.

    require("./locales/" + language);
  • #12907 6f2635a Thanks @dyc3! - Added the nursery rule noLateCurrentTargetAccess, which reports reads of event.currentTarget that run after the browser has finished handling the event, when currentTarget is null.

    element.addEventListener("click", async (event) => {
    await save();
    event.currentTarget.disabled = false;
    });
  • #12904 04f30c4 Thanks @dyc3! - Added the nursery rule noMisusedSpread, which uses type information to report spreads that produce unexpected results: strings spread into arrays or arguments, and promises, functions, maps, arrays, iterables, class instances, and classes spread into objects or JSX attributes.

    declare function getUser(): Promise<{ name: string }>;
    const user = { ...getUser() };
  • #12893 5d7ca32 Thanks @dyc3! - Added the nursery rule noTripleSlashReference, which reports /// <reference path="..." /> comments and /// <reference types="..." /> comments for packages that the file also imports. The lib, path, and types options control which kinds of references are allowed.

    /// <reference path="./globals.d.ts" />
  • #12561 746c421 Thanks @dyc3! - Added the nursery rule noVueAsyncComputed, which reports asynchronous code in Vue computed properties, such as async functions, await, promises, setTimeout(), and nextTick().

    <script>
    export default {
    computed: {
    async user() {
    return fetchUser(this.userId);
    },
    },
    };
    </script>
  • #12964 149d729 Thanks @dyc3! - Added the nursery rule noVueDefineModelDefault, which disallows the default option in Vue’s defineModel(). When a parent component passes undefined with v-model, the child component uses the default value while the parent keeps undefined, so the two components show different values.

    <script setup>
    const model = defineModel({ type: String, default: "" });
    </script>
  • #13060 67bc9d5 Thanks @dyc3! - Added the nursery rule noVueDeprecatedFilter, which reports the filter syntax that Vue 3 removed.

    For example, the following template uses the currency filter:

    <template>
    <p>{{ price | currency }}</p>
    </template>
  • #12545 0bbe4f1 Thanks @dyc3! - Added the new nursery rule noVueDeprecatedVIs, which reports the deprecated Vue v-is directive. Use the is attribute with a vue: prefix instead.

    <template>
    <div v-is="'MyComponent'"></div>
    </template>
  • #12580 3fdc987 Thanks @dyc3! - Added the nursery rule noVueExportInScriptSetup, which disallows export in Vue <script setup> blocks. Vue fails to compile a component when its <script setup> block exports a value. TypeScript type exports are allowed.

    <script setup>
    export const message = "Hello";
    </script>
  • #13063 d4e90c8 Thanks @dyc3! - Added the nursery rule noYamlEmptyMapKeys, which reports YAML map entries whose key is missing, or has only a tag or an anchor. The rule is recommended.

    : value
  • #13061 97aa183 Thanks @dyc3! - Added the nursery rule noYamlEmptyMapValues, which reports keys in YAML maps that have no value.

    name:
  • #13062 6aad75f Thanks @dyc3! - Added the new nursery rule noYamlEmptySequenceEntries, which reports empty items in YAML lists.

    fruits:
    - apple
    -
    - banana
  • #13082 c1c8c85 Thanks @dyc3! - Added the nursery rule useCalledWith, which reports toHaveBeenCalled(), toBeCalled(), and toHaveBeenCalledOnce() assertions, because they don’t check the arguments that the function was called with. The rule belongs to the test domain.

    expect(sendEmail).toHaveBeenCalled();
  • #13075 acfeaf9 Thanks @dyc3! - Added the nursery rule useExpectToHaveBeenCalled, which reports tests that compare the number of calls of a mock function to zero, and suggests using toHaveBeenCalled() instead.

    expect(sendEmail).toHaveBeenCalledTimes(0);
  • #13076 cf5b1a6 Thanks @dyc3! - Added the nursery rule useExpectToHaveBeenCalledTimes, which reports tests that check the length of mock.calls with toHaveLength(), and suggests using toHaveBeenCalledTimes() instead.

    expect(onSave.mock.calls).toHaveLength(1);
  • #13020 5d28641 Thanks @dyc3! - Added the new nursery rule usePackageJsonValidLicense, which reports a license field in package.json that isn’t a valid license. The rule accepts SPDX license identifiers and expressions, UNLICENSED, and references to a license file such as SEE LICENSE IN LICENSE.md.

    For example, the rule reports the following package.json file because GPL3 isn’t an SPDX license identifier:

    {
    "name": "my-package",
    "license": "GPL3"
    }
  • #13079 058d7a1 Thanks @dyc3! - Added the nursery rule useSpyOn, which reports properties that are overwritten with jest.fn() or vi.fn(). Overwriting a property loses its original value, while jest.spyOn() and vi.spyOn() keep it so it can be restored after the test.

    Date.now = jest.fn(() => 10);
  • #13081 be58f67 Thanks @dyc3! - Added the nursery rule useTopLevelRequire, which reports require() calls that aren’t at the top level of the module, such as calls inside functions, blocks, or try statements.

    function readFile(filename, callback) {
    const fs = require("fs");
    fs.readFile(filename, callback);
    }
  • #13054 4d81f0d Thanks @dyc3! - Added the nursery rule useValidNamespaceImports, which reports names read from a namespace import that the imported module doesn’t export. It also reports assignments to members of a namespace import, and namespace imports of modules that have no exports.

    import * as utils from "./utils.js";
    utils.subtract(2, 1); // `./utils.js` doesn't export `subtract`
  • #13058 ae251e4 Thanks @dyc3! - Added the new nursery rule useVueConsistentVOnHandlerStyle, which enforces one style of event handler in Vue v-on directives. By default, it prefers the name of a method, and an inline function where a method name can’t be used.

    <template>
    <button @click="save()">Save</button>
    </template>
  • #12965 c33c03d Thanks @dyc3! - Added the nursery rule useVueRegisteredComponentNameCasing, which requires the names of components registered in the components option of a Vue component to use one casing style. By default, names must be in PascalCase. The casing option switches the rule to camelCase or kebab-case.

    <script>
    export default {
    components: {
    "todo-item": TodoItem,
    },
    };
    </script>
  • #12145 596a2b1 Thanks @ematipico! - Added type narrowing for unwritten local let/const variables and parameters after typeof, equality, nullish, and truthiness checks. Type-aware rules now use these refinements in branches, short-circuit expressions, and after early returns, including noUnnecessaryConditions and noFloatingPromises. Types such as {} no longer imply that a value is always truthy.

  • #12935 e506ff1 Thanks @dyc3! - Improved the performance of the rules noRedeclare and noUnsafeDeclarationMerging. biome lint with Biome’s default rules is now about 3% to 5% faster on large projects, and up to 11% faster on some TypeScript projects.

  • #13181 e1556ae Thanks @dyc3! - Fixed the HTML formatter printing a comment twice when it ends the line of an element’s opening tag. For example, <div><!-- comment --> followed by <i>x</i></div> on the next line is now formatted as:

    <div><!-- comment -->
    <div>
    <!-- comment -->
    <i>x</i>
    </div>
  • #13130 1b350ed Thanks @dyc3! - Fixed #13107: the unsafe fix of noDistractingElements now removes the whole element, including its closing tag and children, instead of only the opening tag. The fix is no longer offered when removing the element would produce invalid code, such as const Ticker = () => <marquee>News</marquee>;.

  • #13054 4d81f0d Thanks @dyc3! - Fixed noUnresolvedImports reporting names that a module re-exports from a CommonJS module or from a file that isn’t JavaScript, such as export { foo } from "./legacy.cjs". The rule now also reports default imports from a module that only re-exports another module with export * from, because export * from doesn’t forward the default export.

  • #12602 d5da394 Thanks @dyc3! - Fixed #12600: biome lint --suppress now adds suppression comments for diagnostics emitted by plugins, such as // biome-ignore lint/plugin/noFoo: ignored using `--suppress` .

  • #13097 3be9e3d Thanks @ashokram-si! - Fixed #13064: The noUnknownTypeSelector rule now correctly accepts the valid <selectedcontent> HTML element used in customizable select controls.

  • #13181 e1556ae Thanks @dyc3! - Fixed #13167: The HTML formatter no longer deletes comments that follow a Svelte block delimiter on the same line, such as {#if}, {:else}, or {#each}. For example, {#if a}<!-- comment --><i>x</i>{/if} is now formatted as:

    {#if a}
    <i>x</i>
    <!-- comment --><i>x</i>
    {/if}
  • #12845 e3ab04d Thanks @dyc3! - Fixed the location of Tailwind CSS diagnostics reported on unquoted object keys. In clsx({ shadow: active }), diagnostics now highlight shadow instead of starting one character later at hadow:.

  • #13098 d3be626 Thanks @ashokram-si! - Fixed #13084: The useThisInClassMethods rule now correctly recognizes this when used inside parameter default values for methods, setters, and class fields.

  • #13131 a788cac Thanks @dyc3! - Fixed #13129: the fix of useArrowFunction no longer produces invalid code when the function is in the initializer of a for statement and returns an in expression. The arrow function body is now wrapped in parentheses.

    // Before
    for (let has = function (k) { return k in cache; }; ;) {}
    // After the fix
    for (let has = (k) => (k in cache); ;) {}
  • #12840 8908627 Thanks @dyc3! - Fixed #12796: useMathMinMax no longer reports comparisons with a bigint written as an expression, such as -1n or 2n ** 62n - 1n, or with a const variable initialized with one. Its unsafe fix turned these comparisons into Math.min() or Math.max() calls, which throw a TypeError when given a bigint.

    const MAX = 2n ** 62n - 1n;
    const clamp = (x) => (x > MAX ? MAX : x);
  • #13152 61924f6 Thanks @dyc3! - Fixed noVueWatchAfterAwait, noVueLifecycleAfterAwait and noVueRestrictedCallAfterAwait, which now also check the setup() function passed as the first argument of defineComponent(). The following code is now reported:

    import { defineComponent, onMounted } from "vue";
    defineComponent(async (props) => {
    await load();
    onMounted(() => {});
    }, { props: ["id"] });

    When defineComponent() receives both a function and an options object, these rules now ignore the setup option, because Vue runs the function instead.

  • #13152 61924f6 Thanks @dyc3! - noVueDuplicateKeys now checks the properties returned by a setup() method of an options object, so return { foo } conflicts with a prop, data property, method or computed property named foo.

  • #13152 61924f6 Thanks @dyc3! - The Vue emit rules now read events declared with a function type, as in defineEmits<(e: "change", value: string) => void>(), and event names written as template literals without substitutions, as in emit(`change`). noVueUndeclaredEmits, noVueUnusedEmitDeclarations, useVueSingleEventPayload and useVueEmitValidator previously skipped events declared in these forms.

    noVueShadowNativeEvents now checks this.$emit() only where this is the component, and no longer reports $emit() called through a variable that holds this, as in const vm = this; vm.$emit("click").

  • #12947 a54965d Thanks @machadinhos! - Added the nursery rule noDrizzleDbObjectInsideTransaction, which reports a Drizzle ORM instance used inside its own transaction callback instead of the transaction object.

    await db.transaction(async (tx) => {
    await db.insert(users).values({ name: "John" });
    });
  • #13123 e7c8297 Thanks @ematipico! - Fixed #12176: type-aware rules now select the matching overload of a method declared several times in an interface or object type. For example, useAwaitThenable no longer reports await app.listen({ port: 0 }) on a Fastify server, and still reports await app.listen({ port: 0 }, callback).

  • #12059 87784c7 Thanks @dyc3! - Fixed noUnsafePlusOperands treating the negation of a bigint value as a number. Code such as -value + 1n, where value is declared as bigint, is no longer reported for mixing number and bigint.

  • #13151 be372b5 Thanks @dyc3! - Fixed Vue lint rules such as useVueVModel and useVueVOnExact treating MathML elements like <math> and <mi> as components. Biome now recognizes the MathML Core elements as native elements, and in Vue, Svelte, and Astro files it treats known hyphenated elements such as <annotation-xml> and the SVG <font-face> as native elements instead of components.

  • #12059 87784c7 Thanks @dyc3! - Type inference now evaluates conditional types such as T extends U ? X : Y, including infer and distribution over unions, instead of treating them as a union of both branches. This also applies to built-in types such as Exclude, Extract, ReturnType, Parameters, and Awaited, which improves the accuracy of type-aware rules such as noFloatingPromises.

    type Unwrap<T> = T extends Promise<infer U> ? U : T;
    // Previously inferred as `unknown | Promise<number>`, now as `number`.
    type Value = Unwrap<Promise<number>>;
  • #12602 d5da394 Thanks @dyc3! - Biome now reports an error when a GritQL plugin file name contains invalid characters that could conflict with Biome suppressions.

  • #12838 81d8d28 Thanks @dyc3! - Added the nursery rule noTailwindRestrictedClasses for JavaScript and HTML. It reports the Tailwind CSS classes and variants listed in its options with a custom message, and can replace them with a configured class or variant.

    {
    "linter": {
    "rules": {
    "nursery": {
    "noTailwindRestrictedClasses": {
    "level": "error",
    "options": {
    "classes": {
    "bg-green-500": { "message": "Use the success color.", "use": "bg-success" },
    "float-*": "Use flexbox or grid for layout."
    }
    }
    }
    }
    }
    }
    }
    <div className="hover:bg-green-500 float-left" />; // both classes are reported
  • #12932 68e6887 Thanks @dyc3! - Improved the performance of linting files that have no suppression comments by up to 61%.

  • #13136 dcb1eab Thanks @dyc3! - Improved the performance of linting JavaScript and HTML files when Tailwind rules are enabled.

  • #13094 ae66383 Thanks @dyc3! - Fixed #12994: the HTML formatter no longer moves a word onto its own line when it follows an inline element or {expression} that starts a line. Formatting such text is now stable after one pass.

    <span>
    Showing the first {shown} of
    {total}
    references
    {total} references
    </span>
  • #13162 854ff15 Thanks @Punisheroot! - Fixed #13125: noUselessThisAlias no longer reports aliases used in instance and static class field initializers, where replacing the alias with this changes which object is accessed.

  • #12059 87784c7 Thanks @dyc3! - Fixed type inference for the intersection of a primitive type and one of its literal types, such as string & "a", which Biome inferred as never instead of "a". Type-aware rules such as useExhaustiveSwitchCases and noFloatingPromises now see the literal, so the following switch is reported for missing the "a" case.

    type Kind = ("a" & string) | "b";
    function handle(kind: Kind) {
    switch (kind) {
    case "b":
    break;
    }
    }
  • #12551 ca039a1 Thanks @pkallos! - Fixed #9842: useNullishCoalescing no longer skips || and ||= inside a call to a locally declared Boolean when ignoreBooleanCoercion is enabled.

2.6.9

Patch Changes

  • #13192 d9e86ab Thanks @dyc3! - Added the nursery rule noArrayDelete. It reports the delete operator used on array elements, which leaves an empty slot in the array instead of removing the element. The rule needs type information, and offers an unsafe fix that replaces the delete with a splice() call.

    declare const array: number[];
    delete array[0];
  • #13209 4408dd4 Thanks @dyc3! - Added the nursery rule noExpectToHaveBeenCalledOnce, which reports toHaveBeenCalledOnce() and toBeCalledOnce() assertions and suggests toHaveBeenCalledTimes(1) and toBeCalledTimes(1) instead. The rule belongs to the test domain.

    expect(sendEmail).toHaveBeenCalledOnce();
  • #13217 c0dc090 Thanks @dyc3! - Added the new nursery rule noImmediateMutation, which reports arrays, objects, Sets, and Maps that are changed in the statement right after they are created, and variables that are assigned right after they are declared.

    const array = [1, 2];
    array.push(3); // reported: write `[1, 2, 3]` instead
    let foo;
    foo = 1; // reported: write `let foo = 1` instead
  • #13120 54eb224 Thanks @dyc3! - Added the nursery rule noJasmineGlobals, which reports Jasmine globals in Jest tests, such as spyOn(), fail(), pending(), and the jasmine object. Jest’s default test runner doesn’t provide them.

    jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
  • #13122 6e2b42e Thanks @dyc3! - Added the nursery rule noReturnInTest, which reports return statements directly inside the body of a test function. The rule belongs to the test domain.

    test("adds two numbers", () => {
    return expect(add(1, 2)).toBe(3);
    });
  • #13161 37692e2 Thanks @dyc3! - Added the nursery rule noTailwindConflictingClasses, which reports Tailwind CSS classes that set the same CSS properties on an element. Only one of the conflicting classes takes effect, so the other one does nothing.

    <div className="flex grid" />;
  • #13119 0cc8548 Thanks @dyc3! - Added the nursery rule noTestGlobals, which reports Jest and Vitest APIs that are used as global variables instead of being imported.

    describe("sum", () => {});
  • #13121 5065890 Thanks @dyc3! - Added the nursery rule noTestHooks, which reports setup and teardown hooks in tests, such as beforeEach and afterAll.

    beforeEach(() => { // reported
    cart = createCart();
    });
  • #13207 328be47 Thanks @dyc3! - Added the nursery rule noUnsafeSqliteInterpolation, which reports SQL strings that insert values with ${} or use a tagged template when passed to the exec() and prepare() methods of a node:sqlite database.

    import { DatabaseSync } from "node:sqlite";
    const database = new DatabaseSync(":memory:");
    database.exec(`SELECT * FROM users WHERE id = ${id}`);
  • #12544 0d70b09 Thanks @dyc3! - Added the new nursery rule noUselessBind, which disallows .bind() calls on functions that don’t use this, and on arrow functions.

    const handler = function () {
    console.log("clicked");
    }.bind(this); // reported
  • #13216 a1c2950 Thanks @dyc3! - Added the nursery rule noUselessDefaultAssignment, which uses type information to report default values that can never be used, because the value they replace can’t be undefined.

    function greet({ name = "friend" }: { name: string }) {} // reported
  • #13101 981cd33 Thanks @dyc3! - Added the new nursery rule noUselessNestedTernary, which reports nested ternary expressions that repeat a result of the expression around them. The conditions of such expressions can be combined with && or ||.

    const result = a ? (b ? c : d) : d;
  • #13100 8ece6a5 Thanks @dyc3! - Added the nursery rule noUselessSetConstruction, which reports a new Set() that only copies a value used with a Set method such as union() or isSubsetOf(). These methods accept a Set or a Map directly, don’t change the Set they are called on, and return a new Set when they combine values.

    const selected = new Set([1, 2]);
    const other = new Set([2, 3]);
    selected.union(new Set(other));
    new Set(selected).union(other);
    new Set(selected.union(other));
  • #13164 dc11dea Thanks @dyc3! - Added the nursery rule noVueDuplicateVElseIf, which reports v-else-if conditions in Vue templates that repeat, or are covered by, earlier conditions of the same v-if / v-else-if chain.

    For example, the second element below can never be rendered:

    <template>
    <div v-if="a || b" />
    <div v-else-if="a" />
    </template>
  • #13194 9bd7f56 Thanks @dyc3! - Added the new nursery rule noVueNegationElse, which reports a negated condition in v-if or v-else-if when a v-else branch follows it. Its fix removes the negation and swaps the two branches.

    <template>
    <div v-if="!isLoading">Content</div> <!-- reported -->
    <div v-else>Loading...</div>
    </template>
  • #13271 31fad4a Thanks @dyc3! - Added the nursery rule useBiomeKindSets, which reports Biome JS plugins that check the kind of a node or token against several strings. A kind set created with nodeKinds() or tokenKinds() reads the kind natively, which is faster.

    The rule belongs to the new biomePlugin domain. Biome doesn’t enable this domain automatically, so enable it in the linter configuration of your plugin project.

    if (node.kind === "JS_CALL_EXPRESSION" || node.kind === "JS_NEW_EXPRESSION") {}
  • #13271 31fad4a Thanks @dyc3! - Added the nursery rule useBiomeTopLevelTypes, which reports the use of nodeKinds(), tokenKinds(), or union() inside a function. The rule belongs to the biomePlugin domain.

    import { defineRule, nodeKinds } from "@biomejs/runtime/plugin";
    export const rule = defineRule({
    run(node) {
    return nodeKinds("JS_CALL_EXPRESSION").has(node);
    },
    });
  • #13191 4a21426 Thanks @dyc3! - Added the new nursery rule useConsistentIndexedObjectStyle, which requires one style for object types with arbitrary keys. By default, it requires the Record type instead of index signatures and mapped types.

    // reported, prefer `Record<string, number>`
    interface Scores {
    [name: string]: number;
    }
  • #13205 adde697 Thanks @dyc3! - Added the nursery rule useDescribeFunctionTitle, which reports test suites (describe blocks) whose title is a string or a .name property that repeats the name of an imported value, and suggests passing the value itself as the title.

    import { myFunction } from "./myFunction";
    describe("myFunction", () => {}); // reported
  • #13206 32daef0 Thanks @dyc3! - Added the nursery rule useEarlyContinue, which reports an if statement that wraps the rest of a loop body and suggests skipping the iteration early with continue instead.

    for (const item of items) {
    if (item.isActive) {
    process(item);
    save(item);
    }
    }
  • #13211 aaf89d6 Thanks @dyc3! - Added the nursery rule useExpectEqualityMatcher, which reports assertions that compare two values with === or !== inside expect() and check the result against a boolean. Using an equality matcher instead makes failing tests show both values.

    // Invalid
    expect(total === 10).toBe(true);
    // Valid
    expect(total).toBe(10);
  • #13092 432e8c8 Thanks @dyc3! - Added the nursery rule useExpectToHaveLength, which reports tests that check the length property with toBe(), toEqual(), or toStrictEqual(), and suggests using toHaveLength() instead.

    expect(files.length).toBe(1);
  • #13091 6f231d0 Thanks @dyc3! - Added the nursery rule useExpectToStrictEqual, which reports tests that compare values with toEqual(), and suggests using toStrictEqual() instead. toEqual() ignores properties set to undefined, so the following test passes even though the two objects are different.

    expect({ a: "a", b: undefined }).toEqual({ a: "a" });
  • #13215 3677e52 Thanks @dyc3! - Added the new nursery rule useTanstackQueryExhaustiveDependencies, which reports TanStack Query options whose queryKey doesn’t include every value that queryFn uses. When the key misses a value, changing that value doesn’t fetch new data, and the query keeps returning data for the old value.

    function Todo({ todoId }) {
    useQuery({
    queryKey: ["todo"],
    queryFn: () => fetchTodo(todoId),
    });
    }
  • #13212 32f5c05 Thanks @dyc3! - Added the nursery rule useTanstackQueryMutationPropertyOrder, which requires onMutate to come before onError and onSettled in the options of TanStack Query’s useMutation. The type of the value that onMutate returns can be wrong in a property that comes before it.

    import { useMutation } from "@tanstack/react-query";
    useMutation({
    mutationFn: (todo) => saveTodo(todo),
    onError: (error, todo, saved) => restoreTodo(saved.previousTodo),
    onMutate: (todo) => ({ previousTodo: readTodo(todo.id) }),
    });
  • #13103 c3f850e Thanks @dyc3! - Added the nursery rule useTopLevelDescribe, which reports tests and hooks that are not inside a describe block. The maxTopLevelDescribes option also limits how many top-level describe blocks a file can have.

    test("adds two numbers", () => {});
  • #13344 60da8a9 Thanks @Jayllyz! - Improved the performance of GritQL plugins on files with many matches. Evaluation time no longer grows quadratically with the number of matches.

  • #13008 01ce2dd Thanks @ematipico! - Improved Astro cross-language JavaScript analysis by resolving embedded bindings and references through Astro scopes instead of document-wide name matching.

  • #13011 a5aa4f2 Thanks @ematipico! - Fixed #12818: useFilenamingConvention now reports a filename diagnostic once per HTML, Vue, Svelte, or Astro document instead of once per embedded JavaScript snippet.

  • #11372 6ce9395 Thanks @renovate! - Improved how Biome aligns edits in diagnostic fix previews. Suggested fixes now group nearby edits more clearly, which can change which repeated lines are shown as unchanged.

  • #13273 9add717 Thanks @tats-u! - Fixed #13267: biome migrate prettier now enables markdown.parser.frontmatter, matching Prettier’s parsing of YAML frontmatter in Markdown files.

  • #13013 e2a8e85 Thanks @ematipico! - Implemented the runtime default-export case from #11463 with the new noAstroComponentDefaultExport nursery rule. The rule reports runtime default exports in Astro component frontmatter while allowing named and type-only exports.

    ---
    export default function render() {}
    ---
  • #13010 8bdb36c Thanks @ematipico! - Fixed #12956: useImportType now distinguishes Astro template type and value uses, while useConst and noVar account for template writes. Cross-language references now prevent unsafe unused-variable rename suggestions.

  • #13015 2ec6bbe Thanks @ematipico! - Fixed #5242: the HTML-family formatter now collapses whitespace in static class attributes and formats valid style attributes as inline CSS declarations. Component props, dynamic Astro template values, and style attributes containing invalid CSS remain conservative. Embedded replacements also recompute parent layout so formatting converges in one pass.

    <div class=" card selected " style="color:red;font-size:10px"></div>
    <div class="card selected" style="color: red; font-size: 10px;"></div>
  • #13018 cfb4467 Thanks @ematipico! - Fixed #12956: React, React Native, and Next.js rules that rely on framework-specific JSX behavior no longer report Astro template expressions. Mixed-framework projects can enable those rule domains without receiving React- or Next-specific diagnostics for Astro markup such as <head>, <img>, component children props, string refs, Astro list rendering, or Polyfill.io scripts.

  • #12419 03b0edd Thanks @vibbix! - Fixed #9768: noDescendingSpecificity no longer reports nested selectors that style different elements. The following code is now valid:

    .aaa {
    ul li {
    &:hover { color: #1684fc; }
    }
    }
    .bbb {
    a {
    &:hover { background: #fff; }
    }
    }

    The rule now reports a:hover { color: red; } followed by a { color: blue; }, as Stylelint does, and ignores rules without declarations.

  • #13103 c3f850e Thanks @dyc3! - Fixed the detection of describe blocks in the test rules noIdenticalTestTitle, useTestHooksOnTop, and useTestHooksInOrder. These rules treated describe.todo, describe.shuffle, test.describe.parallel, and test.describe.serial as tests, and they didn’t recognize conditional blocks such as describe.skipIf(condition)("title", () => {}). As a result, they didn’t check the tests and hooks inside those blocks.

    For example, noIdenticalTestTitle now reports the second test:

    test.describe.serial("checkout", () => {
    test("pays", async ({ page }) => {});
    test("pays", async ({ page }) => {});
    });

    The nursery rule useValidTestTitle now also checks the titles of tagged-template tables such as test.each`table`("title", () => {}) and of conditional calls such as test.skipIf(condition)("title", () => {}).

  • #12548 c919f1c Thanks @pkallos! - Fixed useNullishCoalescing reporting inert || undefined when inert is destructured with a default value, such as { inert = false }.

  • #12419 03b0edd Thanks @vibbix! - Fixed noDuplicateSelectors missing some duplicates. The rule now reports these selectors:

    .c:is(.a .b) {}
    :is(.a .b).c {}
    [data-progress="50%"] {}
    [data-progress="50%"] {}
  • #13262 b359a58 Thanks @GBra-4-669! - Fixed #13258: the HTML parser no longer panics when a CDATA section starts with a second <![CDATA[ marker. The marker is kept as literal text.

  • #13301 d06ae5d Thanks @dyc3! - Fixed #13299: the HTML formatter no longer adds a line break between whitespace-sensitive siblings that touch in the source, such as an element next to a self-closing element, a Svelte {@render} tag, or a text expression. The line break rendered as a space that wasn’t in the source.

    <p>
    <span class="label">label</span><img src="image.png">
    <span class="hint">hint</span>
    <span class="label">label</span><img src="image.png"><span class="hint"
    >hint</span
    >
    </p>
  • #13180 ee7e535 Thanks @GBra-4-669! - Fixed #13178: the JS parser no longer panics on import.defer or import.source when either is parsed as an expression without a following parenthesized argument list. It reports a syntax error instead.

  • #13269 b6e7d37 Thanks @andrew-hesse! - Fixed #13268: the Markdown formatter no longer pairs emphasis markers across paragraphs of a blockquote.

    > a _**, b
    > a ___, b
    >
    > c 20**.
    > c 20__.
  • #13372 399f3a1 Thanks @dyc3! - Fixed #13334: the Markdown formatter now uses indentWidth to indent the content of list items, as Prettier does with tabWidth. Some content keeps its current alignment, such as blockquotes, HTML blocks, and lists inside blockquotes.

    With indentWidth set to 4:

    - parent
    second paragraph
    - child
    second paragraph
    - child
  • #13083 a0acfd5 Thanks @jfmcdowell! - Fixed a Markdown parser hang on block quote lines that contain only spaces after the >. For example, Biome no longer hangs when the second line below has two or more spaces after the >:

    - > - a
    >
  • #13375 70d6154 Thanks @garysassano! - Fixed the HTML formatter adding a line break between a Svelte block ({#if}, {#each}, {#await}, {#key}, {#snippet}) or tag ({@const}, {let}, {@debug}) and a sibling that touches it in the source. Svelte keeps that line break as a text node, so the page rendered a space that wasn’t in the source.

    <p>
    Total:
    {#each items as item}
    Total:{#each items as item}
    <b>{item}</b>
    {/each}
    .
    {/each}.
    </p>
  • #13012 ef2d71a Thanks @ematipico! - Fixed #12707: useValidAriaValues no longer reports Astro template-literal attributes that contain substitutions because their runtime value is unknown. Static template-literal attributes remain checked.

  • #13184 3f72ebe Thanks @dyc3! - Fixed noFloatingPromises, which now detects unhandled promises returned through generic class methods, such as factory.create<Promise<void>>().

  • #13342 eb51fdb Thanks @Jayllyz! - Improved the performance of GritQL plugins, especially for plugins that report many matches in large files.

  • #13009 4ea9690 Thanks @ematipico! - Fixed #12956: noUndeclaredVariables now respects Astro server and client scopes, define:vars, and type/value namespaces. noUnusedVariables, noUnusedImports, and noUnusedFunctionParameters now follow resolved Astro symbols and treat write-only template references as unused.

  • #13193 f0e63ff Thanks @dyc3! - Improved performance of all parsers. On large projects, biome lint is up to 1.7% faster.

  • #13016 5d4d474 Thanks @ematipico! - Fixed #12956: Biome now leaves the contents of unsupported <script> and <style> blocks unchanged instead of trying to format them as JavaScript or CSS. This includes embedded languages such as Less, SCSS, PostCSS, CoffeeScript, and custom lang or type values.

    <style lang="less">
    @color: red;
    .card { color: @color; }
    </style>
    <script lang="coffee">
    square = (value) -> value * value
    </script>

    Malformed Astro frontmatter, expressions, scripts, and styles also retain their original text while Biome formats the surrounding markup.

  • #13208 c4d56be Thanks @dyc3! - Added the nursery rule noCanvasToImage, which reports canvases that are converted to an image or copied pixel by pixel only to be drawn onto another canvas. Pass the canvas to drawImage() instead.

    const image = await loadImage(canvas.toDataURL());
    context.drawImage(image, 0, 0);
  • #13195 f126262 Thanks @dyc3! - Added trivia APIs to JavaScript plugins. leadingTrivia() and trailingTrivia() on nodes and tokens return the whitespace, line breaks, and comments around them, and leadingComments() and trailingComments() on tokens return only the comments. Each piece has an isComment() method. registerDiagnostic() now also accepts tokens and trivia pieces, and highlights only that element.

    const keyword = statement.declaration.token("kindToken");
    for (const comment of keyword.leadingComments()) {
    if (comment.text.includes("TODO")) {
    registerDiagnostic(comment, "warning", "Resolve this TODO.");
    }
    }
  • #12962 2ae8b51 Thanks @dyc3! - Improved the performance of linting with many rules enabled, such as Biome’s recommended rules. In exchange, Biome can use more memory, because each thread now keeps some freed memory for reuse.

  • #12937 4dc698a Thanks @b84330808! - Fixed .editorconfig section globs that have a negative number in a numeric range. [{-3..3}] now matches the files named -3 to 3, instead of only a file named {-3..3}.

  • #12960 9ff9ee4 Thanks @vibbix! - Fixed a crash when a dependency’s package.json maps an exports entry to its own package name, such as "exports": { "sass": "my-package" }. Like Node.js, Biome now rejects exports targets that don’t start with ./.

  • #12960 9ff9ee4 Thanks @vibbix! - Fixed noUnusedClasses reporting classes of SCSS partials loaded with @use, @forward or @import. Biome now resolves these loads the way Sass does, including partials such as _card.scss, index files, and import-only files, so a class in _card.scss counts as used when a component imports styles.scss, which contains @use "card".

  • #13139 103dc4e Thanks @dyc3! - Made noArrayForEach, noArraySortForMinMax, noBooleanSortComparator, noNegatedArrayPredicate, noReturnArrayPush, and useIteratorZip agree on which values are known not to be arrays. They now all ignore calls on literals, object literals, functions, classes, new expressions other than new Array() or a typed array, and variables whose type annotation, type alias, or const value is one of those or a built-in type such as Map, Set, or string | undefined. A type declared in the file with the same name as a built-in type, such as type Set<T> = T[], is no longer treated as the built-in type.

    // No longer reported by noArrayForEach
    new Collection().forEach((value) => console.log(value));
  • #12941 ea3b347 Thanks @dyc3! - Improved the performance of biome lint, biome check, and biome ci on Linux. Biome now spends less time in the operating system for each file it analyzes, so linting large projects is faster.

  • #13343 b9fdaba Thanks @ematipico! - Fixed range formatting in the editor for Vue, Svelte, and Astro files when full HTML support is disabled. Selections that end before the script block no longer format it or report an error, and edits for selections inside the script block are now applied at the selected location.

  • #13007 6981d43 Thanks @ematipico! - Recognized Astro <style define:vars> keys as custom-property declarations. The noUndeclaredCustomProperties rule now accepts statically supplied variables and avoids diagnostics when dynamic keys may provide a declaration.

  • #13001 11027d4 Thanks @ematipico! - Fixed #10547: Astro files can now place <!doctype html> after top-level elements such as inline scripts without parse errors, and formatting preserves the source order.

    <script is:inline>console.log("ready");</script>
    <script is:inline>
    console.log("ready");
    </script>
    <!doctype html>
  • #13343 b9fdaba Thanks @ematipico! - Fixed #13257: untitled VS Code documents now use their existing workspace project, retain it across workspace-folder removal and re-addition, avoid creating projects from non-file URIs, and preserve URI extensions for language detection.

  • #13345 c071912 Thanks @dyc3! - Fixed #13335: Svelte {#snippet} blocks with type parameters, such as {#snippet row<T extends string>(item: T)}, are now parsed and formatted. Invalid snippet signatures no longer make the linter panic.

  • #13343 b9fdaba Thanks @ematipico! - Fixed #12317 and #12984: VCS ignore matching now preserves logical paths for external and symlinked inputs, normalizes stdin paths, combines coexisting .gitignore and .ignore rules, respects nested ignore precedence and Git’s repository exclude file, and reloads ignore state when ignore files change.

  • #13014 0c0dfe2 Thanks @ematipico! - Fixed #12349: Biome now reads quote character references, such as &quot; and &[#39](https://github.com/biomejs/biome/issues/39);, as string quotes in the CSS of HTML and SVG style attributes. Valid values such as font-family: &quot;Rotis Sans&quot; no longer produce CSS parse diagnostics.

  • #13356 abe482c Thanks @github-actions! - Updated the Baseline data of the useBaseline rule. The rule now reports CSS features according to their latest Baseline status.

2.6.10 Latest

Patch Changes

  • #13387 00e98fc Thanks @dyc3! - Added the nursery rule noAmd, which reports AMD define() and require() calls that load modules from a list, so they can be replaced with import statements.

    define(["a", "b"], function (a, b) {});
  • #13357 9407920 Thanks @dyc3! - Added the nursery rule noArrayReduce, which disallows the reduce() and reduceRight() array methods in favor of loops and methods such as map() and filter(). Calls whose function only returns a single arithmetic, comparison, or bitwise operation, such as (total, item) => total + item, are allowed.

    const counts = words.reduce((counts, word) => {
    counts[word] = (counts[word] ?? 0) + 1;
    return counts;
    }, {});
  • #13358 d82324e Thanks @dyc3! - Added the nursery rule noBreakInNestedLoop, which reports break statements without a label inside nested loops and inside switch statements in loops. Enable the checkContinue option to also report continue statements without a label.

    for (const item of items) {
    for (const child of item.children) {
    break; // reported
    }
    }
  • #13488 674687a Thanks @dyc3! - Added the nursery rule noCollectionBracketAccess. It reports square brackets used on a Map, Set, WeakMap, or WeakSet, which read or change a property of the object instead of one of its entries.

    const map = new Map();
    map["foo"] = "bar";
  • #13477 de81ca9 Thanks @dyc3! - Added the nursery rule noConvexCollectInQuery, which reports Convex database queries that load every matching document with .collect(). Use .take() or .paginate() instead.

    const messages = await ctx.db.query("messages").collect();
  • #13323 fae973f Thanks @dyc3! - Added the nursery rule noConvexDuplicateIndexes, which reports Convex database indexes whose fields are the first fields of another index on the same table. The rule is part of the convex domain.

    defineTable({ author: v.string(), channel: v.string() })
    .index("by_author", ["author"]) // reported
    .index("by_author_and_channel", ["author", "channel"]);
  • #13481 4de1a09 Thanks @dyc3! - Added the nursery rule noConvexOldRegisteredFunctionSyntax, which reports Convex queries, mutations, and actions registered with a plain function instead of an object. The object syntax lets you declare an args validator.

    export const list = query(async (ctx) => {
    return await ctx.db.query("messages").collect();
    });
  • #13325 e7dab31 Thanks @dyc3! - Added the new nursery rule noConvexProcessEnv to the convex domain. It reports uses of process.env in the convex folder of a package, and recommends reading environment variables from the typed env object exported by _generated/server instead. Its unsafe fix replaces process.env with env and adds the import.

    convex/giphy.ts
    const apiKey = process.env.GIPHY_KEY;
  • #13324 6609054 Thanks @dyc3! - Added the nursery rule noConvexQueryFilter, which reports .filter() calls on Convex database queries. The database reads every document in the query before .filter() drops the ones that don’t match, so .withIndex() or filtering the collected results in code is preferred. The rule belongs to the convex domain.

    const messages = await ctx.db
    .query("messages")
    .filter((q) => q.eq(q.field("author"), args.author))
    .collect();
  • #13476 cfec26a Thanks @dyc3! - Added the nursery rule noConvexTimeOrRandomInQueries, which reports Convex queries that read the current time or generate random values. Convex caches query results, so these values can be outdated or stay the same between calls.

    export const pickWinner = query({
    handler: async (ctx) => {
    const entries = await ctx.db.query("entries").collect();
    return entries[Math.floor(Math.random() * entries.length)];
    },
    });
  • #13300 1001924 Thanks @dyc3! - Added the nursery rule noConvexTopOfHourCrons, which reports Convex cron jobs scheduled at the start of the hour, the busiest time for most apps.

    crons.hourly("cleanup", { minuteUTC: 0 }, internal.tasks.cleanup);
  • #13482 0466735 Thanks @dyc3! - Added the nursery rule noConvexWrongRuntimeImports, which reports files in a Convex convex folder that run in the Convex runtime but import a file with the "use node" directive.

    // convex/payments.ts, where convex/stripe.ts starts with "use node"
    import { formatAmount } from "./stripe";
  • #13371 adae706 Thanks @dyc3! - Added the nursery rule noDuplicateExports. It reports a module or TypeScript namespace that exports the same name more than once, or has more than one default export. It also reports two export * from statements that export the same name from different declarations. The rule belongs to the project domain.

    export const foo = 1;
    function bar() {}
    export { bar as foo };
  • #13395 3f1f7ce Thanks @dyc3! - Added the nursery rule noDuplicateIfBranches, which reports branches of an if statement that run the same code as the branch right before them.

    if (value === "a") {
    doThing();
    } else if (value === "b") {
    doThing();
    }
  • #13504 ae4791f Thanks @dyc3! - Added the nursery rule noMixedReturns, which reports functions where some return statements return a value and others don’t, including functions that can reach the end of their body after returning a value elsewhere.

    function doSomething(condition) {
    if (condition) {
    return true;
    }
    }
  • #13366 48da9c2 Thanks @dyc3! - Added the nursery rule noMutableExports. It reports exported variables declared with let or var, which other modules see change whenever they are reassigned.

    export let count = 1;
  • #13505 72c3a7e Thanks @dyc3! - Added the nursery rule noNegatedComparison, which reports equality comparisons that are negated as a whole and suggests the opposite operator instead.

    const isDifferent = !(a === b); // use `a !== b` instead
  • #13282 5201ae5 Thanks @dyc3! - Added the nursery rule noOuterScopeInIsolatedFunctions, which reports uses of variables, this, and super from outside a function that runs apart from the code around it, such as a function passed to makeSynchronous() or marked with an @isolated comment.

    const url = "https://example.com";
    makeSynchronous(async () => {
    const response = await fetch(url); // `url` doesn't exist where the function runs
    return response.text();
    });
  • #13474 100d4d7 Thanks @dyc3! - Added the nursery rule noTailwindLegacyImportant for JavaScript and HTML. It reports Tailwind CSS classes that put the ! important modifier at the start, as Tailwind CSS v3 did, and moves the ! to the end of the class name.

    <div className="!flex hover:!bg-red-500" />; // use `flex!` and `hover:bg-red-500!`
  • #13224 19fb503 Thanks @dyc3! - Added the new nursery rule noTanstackQueryUnstableDeps, which reports the object returned by a TanStack Query hook, such as useQuery or useMutation, when it is used directly as a dependency of useEffect, useMemo, or useCallback. This object can be a new object on every render, so React treats the dependencies as changed on every render.

    const mutation = useMutation({ mutationFn });
    const callback = useCallback(() => mutation.mutate("hello"), [mutation]);
  • #13371 adae706 Thanks @dyc3! - Added the nursery rule noUselessReExportAll. It reports export * from a module that has no named exports, which exports nothing. The rule belongs to the project domain.

    // foo.js only has a default export.
    export * from "./foo.js";
  • #12560 1413bf8 Thanks @dyc3! - Added the nursery rule noVueComputedPropertyCall, which disallows calling a Vue computed property whose value is not a function. Calling such a value throws an error when the code runs.

    <script>
    export default {
    computed: {
    total() {
    return 42;
    },
    },
    methods: {
    log() {
    console.log(this.total()); // reported
    },
    },
    };
    </script>
  • #13322 025c012 Thanks @dyc3! - Added the nursery rule noVueContentOutsideBlock, which reports text and code placed outside of the top-level blocks of a Vue component. Vue drops this content, so it never renders or runs.

    For example, console.log(1); below is reported:

    <template>
    <div>Hello</div>
    </template>
    console.log(1);
    <script>
    export default {};
    </script>
  • #13369 7940a3f Thanks @dyc3! - Added the nursery rule useConsistentDefaultExportStyle, which enforces whether default-exported functions and classes are declared inside the export default statement or declared separately and exported by name.

    function foo() {}
    export default foo; // reported
  • #13248 b7a3678 Thanks @dyc3! - Added the nursery rule useConsistentExistenceIndexCheck, which reports checks such as index < 0, index >= 0, and index > -1 on the result of indexOf(), lastIndexOf(), findIndex(), or findLastIndex(), and suggests comparing with -1 instead.

    const index = list.indexOf(item);
    if (index < 0) {}
  • #13305 4bcb0ee Thanks @dyc3! - Added the nursery rule useConvexAccessControl, which reports exported Convex queries, mutations and actions whose handler doesn’t call an access control function, such as requireUser(ctx). The rule belongs to the convex domain.

    import { mutation } from "./_generated/server";
    export const send = mutation({
    args: {},
    handler: async (ctx) => {
    await ctx.db.insert("messages", { body: "hello" });
    },
    });
  • #13475 1cb1e56 Thanks @dyc3! - Added the nursery rule useConvexArgsValidator, which requires Convex queries, mutations, and actions to define an args validator, so that Convex checks the arguments of every call before the handler runs.

    export const list = query({
    handler: async (ctx) => {
    return await ctx.db.query("tasks").collect();
    },
    });
  • #13473 88aa8a5 Thanks @dyc3! - Added the nursery rule useConvexExplicitTableIds, which reports Convex db.get(), db.patch(), db.replace(), and db.delete() calls that don’t pass the table name as the first argument.

    const message = await ctx.db.get(messageId);
  • #13503 764aba8 Thanks @dyc3! - Added the nursery rule useCustomErrorDefinition, which enforces a consistent way of defining custom error classes. It reports error classes whose name doesn’t start with an uppercase letter and end with Error, that don’t set their name property to the class name, that assign this.message instead of passing the message to super(), or that don’t forward an options parameter to a built-in error.

    class FooError extends Error {
    constructor(message) {
    super();
    this.message = message;
    }
    }
  • #13365 6bdb1ff Thanks @dyc3! - Added the nursery rule useElseIf. It reports an if statement that follows another if statement and compares the same variable or property against a different value, since only one of them can match. The rule offers an unsafe fix that adds else before the second if statement.

    if (status === "loading") {}
    if (status === "error") {}
  • #13351 73a0cb6 Thanks @dyc3! - Added the nursery rule useNegativeIndex, which reports index arguments of slice(), at(), subarray(), splice(), and toSpliced() that subtract a number from .length, and suggests a negative index instead.

    foo.at(foo.length - 1); // reported: write `foo.at(-1)` instead
  • #13306 74c72ae Thanks @dyc3! - Added the nursery rule useSetMethods, which reports code that combines or compares Sets by copying them into arrays, and suggests the matching Set method, such as union(), intersection(), difference(), isSubsetOf(), or isDisjointFrom().

    const a = new Set([1, 2]);
    const b = new Set([2, 3]);
    new Set([...a, ...b]);
    [...a].filter((value) => b.has(value));
    [...a].every((value) => b.has(value));
    a.intersection(b).size === 0;
  • #13326 c3bd8ba Thanks @dyc3! - Added the nursery rule useTanstackQueryQueryOptions, which reports TanStack Query options that set queryKey or queryFn where the query is used, and query keys that are written by hand in query client methods. Creating the options once with queryOptions() keeps the key and the function of a query together.

    import { useQuery, useQueryClient } from "@tanstack/react-query";
    function Todo({ id }) {
    const query = useQuery({ queryKey: ["todo", id], queryFn: () => fetchTodo(id) });
    const queryClient = useQueryClient();
    const refresh = () => queryClient.invalidateQueries({ queryKey: ["todo", id] });
    }
  • #13431 c8e0488 Thanks @ematipico! - Improved the performance of commands that process files, such as biome check, biome lint and biome format between 14% and 18%.

  • #13367 addf04a Thanks @dyc3! - Fixed #13320: noUnnecessaryConditions no longer reports loops whose condition is the literal true, such as while (true) {}, do {} while (true), and for (; true;) {}.

  • #13608 c1ac8a0 Thanks @ematipico! - Fixed #13574: the Tailwind CSS rules no longer make Biome scan the whole project. When tailwind.stylesheet is set, Biome reads only that stylesheet and the files it imports. It now reports an error if the stylesheet is missing, outside the project folder, or force-ignored by files.includes.

    useTailwindSortedClasses, noTailwindRawColors, noTailwindRestrictedClasses, and noTailwindConflictingClasses no longer belong to the project domain.

  • #13571 7ac32bd Thanks @dyc3! - Fixed #13511: Biome no longer skips indexing a project located inside a directory that the scanner ignores by default. These are meant to be places where the scanner should not look for files, but if a project is explicitly located inside one, it should still be indexed.

  • #13484 c12cd1c Thanks @dyc3! - Fixed noFloatingPromises reporting promises that are handled through a method named by a string literal. The following code is no longer reported:

    declare const promise: Promise<number>;
    promise["then"]((value) => value, () => {});
    promise["catch"](() => {});
  • #12903 16aaa88 Thanks @yeliex! - Added the nursery rule useConsistentBooleanProps. When enabled, it requires <Foo bar={true} /> by default. Set mode to "implicit" to require the shorthand <Foo bar />.

  • #13540 f1259d2 Thanks @dyc3! - Fixed #13538: Tailwind classes with an arbitrary value that calls a function whose name starts with --, such as w-[--spacing(80)] or text-[--alpha(red/50%)], are parsed correctly again. useTailwindSortedClasses no longer treats them as unknown classes or moves them to the front.

  • #13420 c199c75 Thanks @ematipico! - Fixed a bug where the Biome Scanner would index the same dependencies in node_modules more than once. This would result a slightly faster scanner.

  • #13468 a98859c Thanks @ematipico! - Improved the performance of formatting JavaScript and TypeScript code.

  • #12681 6dbca4c Thanks @NavpreetSSidhu! - Fixed #12625: noComponentHookFactories no longer reports a capitalised object property inside a function unless its function renders JSX or calls a hook.

    function methods(player) {
    return { Next: () => player.next() };
    }
  • #13575 644c81a Thanks @carlosrobert0! - Fixed #12991: the CSS parser no longer panics on a stray ) in an @layer prelude, such as @layer) or @layer a b){}. It now reports a parse error and recovers.

  • #12550 6b63f72 Thanks @atharv1205! - Fixed the formatter output changing on a second run for logical chains. The formatter now flattens a parenthesized right operand with the same logical operator and more than two operands into the surrounding chain on the first pass. Previously, the operands of the removed group stayed together and the next format changed the output again.

    return (
    aaaaaaaaaaaaaaaaaaaa &&
    bbbbbbbbbbbbbbbbbbbbbbb &&
    cccccccccccccccccccc && dddddddddddddddddddddd &&
    cccccccccccccccccccc &&
    dddddddddddddddddddddd &&
    eeeeeeeeeeeeeeeeeeeeeeeee
    );
  • #13498 4755be1 Thanks @dyc3! - Fixed #13396: the Markdown formatter no longer duplicates an HTML comment at the start of an HTML block on every format when the HTML formatter is enabled.

    <!-- foo --><!-- foo -->*bar*
    <!-- foo -->*bar*
  • #13497 8f3c808 Thanks @dyc3! - Fixed #13397: the Markdown formatter no longer turns a paragraph into a heading when a lazy continuation line looks like a setext heading underline. The formatter adds the block quote prefix or list indentation to such a line, so it now escapes the line’s first marker.

    > foo
    bar
    ===
    > bar
    > \===
  • #13499 e2fff80 Thanks @dyc3! - Fixed #13466: the Markdown formatter no longer merges a whitespace-only line in a fenced code block inside a list item with the next line. The line is now printed as an empty line, and the next line keeps its indentation.

    1. Item:
    ```shell
    echo a
    echo b
    echo b
    ```
  • #13496 fb8cede Thanks @dyc3! - Fixed #13408: the Markdown parser now keeps the content of a fenced code block in a list item inside a block quote when a tab follows the > marker. Previously the code block ended after its opening fence, and the formatter moved the code out of the block.

    > - ```text
    > hello
    > ```
  • #13495 8a89af1 Thanks @dyc3! - Fixed #13386: the Markdown parser no longer reports a false “Expected a list item” diagnostic when a list inside a block quote ends with a fenced code block or heading and a list item outside the quote follows a blank line.

    - > - ```text
    > hello
    > ```
    - > - ```text
    > there
    > ```
  • #13289 b6b42d7 Thanks @srikar2130! - Fixed part of #13165: the CSS formatter no longer double-indents the arguments of a functional pseudo-class in a nested selector without a leading combinator, such as &:has(...) or .a:not(...).

  • #13528 66386c5 Thanks @dyc3! - Fixed #13525: noProcessGlobal no longer offers a fix for accesses through the global object, such as globalThis.process or window["process"]. Adding an import doesn’t change what these accesses refer to, so biome lint --write no longer loops on them.

  • #13528 66386c5 Thanks @dyc3! - Fixed #13527: the fix of noProcessGlobal now adds the process import at the top level of the module instead of inside a TypeScript namespace.

  • #13491 cc402fa Thanks @2tsoftwareapp! - Fixed #13428, where noUntrustedLicenses reported valid SPDX license expressions with the + (“or later”) operator (such as Apache-2.0+ and MPL-2.0+) as untrusted.

  • #13160 b56e180 Thanks @dyc3! - Fixed #13108: noUnusedExpressions no longer reports satisfies expressions used as statements, such as shape satisfies never; for exhaustiveness checks.

  • #13514 aef78f6 Thanks @Yshuro! - Fixed node_semver caret range expansion for ^0.0.0 and ^0.0 so that they match the expected upper bounds (<0.0.1 and <0.1.0, respectively) when resolving package.json version ranges.

  • #13405 771de3e Thanks @dyc3! - Fixed #13392: useNullishCoalescing no longer reports flag || other when flag is a parameter whose default value removes undefined from its type, such as flag: boolean | undefined = false.

  • #13281 b6c1d06 Thanks @GBra-4-669! - Fixed #13280: the suppression parser no longer panics on non-ASCII whitespace.

  • #12945 18975d9 Thanks @vibbix! - Fixed noUnknownTypeSelector reporting from and to rules directly inside SCSS mixins and @include blocks that Sass places inside @keyframes:

    @mixin frames {
    from { opacity: 0; }
    to { opacity: 1; }
    }
    @keyframes fade {
    @include frames;
    }
  • #13520 f733558 Thanks @dyc3! - Fixed #11942: useArrayLiterals no longer offers a fix for Array(...args), Array(x, ...args), and other calls whose spread arguments may expand to a single argument. The rule still reports them, but rewriting Array(...args) to [...args] changes the result when args is a single number.

  • #13522 41a4f06 Thanks @dyc3! - Fixed #13331: the safe fix of useImportType with the separatedType style no longer turns a default import used as a value into import type. For example, import spec, { type A, B } from "./mod" now keeps spec as a value import.

  • #13559 dc7e82a Thanks @MaxWang007! - Fixed #13548: the unsafe fix of useLiteralKeys now escapes " and ' when it turns a computed key into a string literal. ['a"b'] and [`a"b`] are rewritten to "a\"b" instead of invalid syntax. A computed key that contains a raw line break is left unchanged.

  • #13565 32ada57 Thanks @diluuuu10! - Fixed #13546: Fixed a false positive in useNamedCaptureGroup by correctly handling escaped parentheses in RegExp strings.

  • #13560 735dddc Thanks @diluuuu10! - Fixed #13547: Updated the useUnifiedTypeSignatures unsafe fix to wrap function types in parentheses when merging them into a union type, preventing invalid TypeScript syntax.

  • #13485 f50b262 Thanks @dyc3! - Improved type inference for Promise. Biome now knows every static member that the TypeScript standard library declares for it, and the types of the resolve and reject callbacks passed to a new Promise() executor. For example, noFloatingPromises now reports the unhandled Promise created by Promise.withResolvers():

    Promise.withResolvers().promise;
  • #13506 87ad81b Thanks @dyc3! - Fixed #13380: useNumberNamespace no longer offers a fix when Number is shadowed by a local binding, because the fix changed the runtime behavior of the code. The rule still reports the global.

  • #13502 ee1f211 Thanks @dyc3! - Fixed #11938: noUselessUndefinedInitialization no longer offers a fix for var declarations. Removing = undefined from a var declaration inside a loop or from a redeclaration changed the behavior of the program, because var x; doesn’t reset the variable.

  • #13501 b11b273 Thanks @dyc3! - Fixed a false positive in useTanstackQueryExhaustiveDependencies: the rule no longer reports the variable that holds the query key when the query function reads it. Previously, the fix added the variable to its own value.

    function useTodo(id, queryClient) {
    const queryKey = ["todo", id];
    return useQuery({
    queryKey,
    queryFn: () =>
    fetchTodo(id).then((todo) => {
    queryClient.setQueryData(queryKey, todo); // No longer reported.
    return todo;
    }),
    });
    }
  • #13595 d15af62 Thanks @dyc3! - Fixed #10716: biome migrate now migrates "recommended": true to "preset": "recommended" regardless of the whitespace and comments around the value. Previously, configurations such as { "recommended": true } were migrated to "preset": "none", which disabled the recommended rules.

  • #12635 2936d85 Thanks @NavpreetSSidhu! - Fixed #12626: usePlaywrightValidDescribeCallback no longer reports calls to a describe function declared in the same file.

  • #13484 c12cd1c Thanks @dyc3! - Fixed noFloatingPromises and noMisusedPromises not recognizing the PromiseLike that the methods of a PromiseLike value return. For example, noFloatingPromises now reports the following code:

    declare const thenable: PromiseLike<number>;
    thenable.then((value) => value);
  • #13618 505a73f Thanks @avens19! - Fixed #13588: rules that scan the project, such as noFloatingPromises, are faster in projects with many dependencies. The CLI no longer prepares to watch dependency folders when it doesn’t watch the project.

  • #12865 7166077 Thanks @carlosrobert0! - Fixed #5172: the JUnit reporter now includes formatting diagnostics, so biome check and biome format list the affected files. Test cases are now grouped into one <testsuite> per file.

  • #13270 2d30ad9 Thanks @dyc3! - Added the new nursery rule noScssDeprecatedColorFunctions. It reports the deprecated Sass functions that read one channel of a color, such as red(), color.hue() and opacity(), and suggests color.channel() instead.

    a {
    opacity: opacity($brand);
    }
  • #13218 840b293 Thanks @dyc3! - Fixed #13088: useHeadingContent now recognizes set:html and set:text as heading content inside Astro template expressions.

  • #13567 6ea6489 Thanks @dyc3! - Fixed #13563: Applying the unsafe fix of noConsole no longer hangs when a console call is used as a value, such as in a variable declaration, a function argument, or a ternary. The rule still reports these calls, but doesn’t offer a fix for them.

    const result = ok && console.log("x");
  • #13483 e3987d2 Thanks @dyc3! - Fixed #13421: in Astro templates and in projects that depend on solid-js, the rules useFocusableInteractive, noPositiveTabindex, noNoninteractiveTabindex, useAriaActivedescendantWithTabindex, and noAriaHiddenOnFocusable now recognize the lowercase tabindex attribute on JSX elements, and their diagnostics and fixes suggest tabindex instead of tabIndex.

    The following code is no longer reported in a Solid project or inside an Astro template expression:

    <div role="button" tabindex={0} onClick={() => {}} />
  • #13418 4de11d2 Thanks @ematipico! - Fixed a bug where Biome couldn’t properly parse Svelte {#each} blocks when some syntax was used to define the keys.

  • #13597 7a56cf9 Thanks @dyc3! - Fixed #13588, a regression where Biome accidentally followed symbolic links inside node_modules.

  • #13521 3ad6f36 Thanks @github-actions! - Updated the Baseline data of the useBaseline rule. The rule now reports CSS features according to their latest Baseline status.

  • #12587 e97ca39 Thanks @kristoferma! - Fixed #10987: useErrorCause now finds the cause in the last argument of a custom error class whose second argument isn’t an object, such as new ErrorWithCode("message", "E_CODE", { cause: err }). Built-in errors keep their usual options position, which is the third argument for AggregateError: new AggregateError(errors, "message", { cause: err }) is now valid, and new AggregateError(errors, { cause: err }) is now reported, because that object is the message and the cause is lost.

  • #13430 b465622 Thanks @dyc3! - Added the nursery rule noVueRestrictedComponentOptions, which reports Vue component options that are listed in its componentOptions option.

    For example, with "componentOptions": ["init", ["props", "*", "twoWay"]], the following component is reported twice:

    <script>
    export default {
    init() {},
    props: {
    name: { type: String, twoWay: true },
    },
    };
    </script>