Skip to content

biome

@biomejs/biome@2.6.7
biomejs/biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

Version of biomejs/biome you run

CompareView on GitHub

Release history

All releases on GitHub
BadgeLatest version of biomejs/biome[![version](/badge/biomejs/biome)](/p/biomejs/biome)

Biome CLI v2.6.7

2.6.7

Patch Changes

  • #12906 b3375d2 Thanks @dyc3! - Added the nursery rule noAsyncPromiseFinally, which reports async functions passed to a promise's .finally() method. If such a function fails, its error replaces the original result or error of the promise.
  promise.finally(async () => {
      await cleanup();
  });
  type T = string | number | string;
  function f(a?: string | undefined) {}
  • #12899 6c15027 Thanks @dyc3! - Added the nursery rule noExcessiveSelectorComplexity, which limits how many IDs, type selectors, attribute selectors, pseudo-classes, universal selectors, compound selectors, and combinators a CSS selector can contain. It can also disallow chosen combinators, pseudo-classes, pseudo-elements, attributes, and attribute operators. The rule does nothing until an option is set.

For example, with "maxIds": 1, the following selector is reported:

  #main #sidebar {}
  • #12897 0b8f429 Thanks @dyc3! - Added the new nursery rule noInvalidFetchOptions, which reports a body in the options of fetch() and new Request() when the method is GET or HEAD. These calls throw a TypeError at runtime. When no method is given, the request uses GET.
  await fetch("/", { method: "GET", body: "foo=bar" });
  • #12926 9b6b9f4 Thanks @dyc3! - Added the nursery rule noNewArray, which reports new Array() calls with a single argument. Such a call creates an empty array of the given length when the argument is a number, and an array that holds the argument otherwise.
  const array = new Array(length);
  • #12895 739440f Thanks @dyc3! - Added the new nursery rule noRedundantTypeConstituents, which reports members of union and intersection types that have no effect, such as a literal type next to its primitive type, or never in a union.
  type Status = "active" | string;
  • #12810 71ab61b Thanks @dyc3! - Added the nursery rule noSvelteAsyncStore, which disallows passing async functions to the writable(), readable(), and derived() stores from svelte/store.
  import { writable } from "svelte/store";
  const user = writable(null, async (set) => {
      set(await fetchUser());
  });
  // foo.js only contains `export function foo() {}`
  import foo from "./foo.js";
  • #12892 f16842e Thanks @dyc3! - Added the nursery rule noUselessFallbackInSpread, which reports empty object fallbacks when spreading a value into an object. Spreading null, undefined, or another falsy value into an object adds no properties, so the fallback has no effect.
  const object = { ...(options || {}) };
  • #12785 c198be2 Thanks @dyc3! - Added the new nursery rule noUselessParameterPropertyAssignment, which reports constructor assignments such as this.name = name when name is a parameter property. TypeScript already sets the property to the parameter's value, so the assignment does nothing.
  class User {
    constructor(public name: string) {
      this.name = name;
    }
  }
  • #12900 a4d1b0f Thanks @dyc3! - Added the nursery rule noUselessSpread, which reports spread syntax that has no effect. For example, [first, ...[second]] can be written as [first, second], and new Set([...items]) can be written as new Set(items).
  • #12902 d7d755b Thanks @dyc3! - Added the nursery rule noVueExposeAfterAwait, which reports expose() and defineExpose() calls that come after an await in a Vue component's setup code. These calls run too late, so a parent component might not receive the exposed properties.

  await fetchUser();
  defineExpose({ reload });

  • #12596 d33e56e Thanks @dyc3! - Added the nursery rule useAtomicUpdates, which reports assignments in async functions and generators that can be based on an outdated value because the function paused at an await or yield after reading it.
  let total = 0;
  async function addToTotal(getAmount) {
      total += await getAmount(); // reported
  }
  • #12901 48e3572 Thanks @dyc3! - Added the new nursery rule useConsistentBooleanName. It requires variables, parameters, and functions that hold or return a boolean to start with a prefix such as is or has, and reports names with those prefixes that don't hold or return a boolean.
  const completed = progress === 100;
  const hasName = "Sindre";
  • #12905 5b00387 Thanks @dyc3! - Added the nursery rule useConsistentFontWeightNotation, which enforces writing font weights either as numbers or as the keywords normal and bold where possible. It checks the font-weight and font properties, and its safe fix converts between normal/bold and 400/700.
  a { font-weight: bold; }
  type Point = [x: number, number];
  • #12925 7252cbd Thanks @dyc3! - Added the new nursery rule useGlobalRegexInMatchAll, which reports calls to matchAll() with a regular expression that doesn't have the g flag. These calls throw a TypeError at runtime.
  text.matchAll(/pattern/);
  withSpaces.replaceAll(/\s+/, ",");
  • #12896 a968e1a Thanks @dyc3! - Added the new nursery rule useValidCharacterComparison, which reports comparisons between a single character and a string that has more than one character. Such comparisons are always false, or always true with !== and !=.
  text.charAt(0) === "ab";

Full release notesCompare with previous