biome
@biomejs/biome@2.6.7A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
- Maintenance
- Active1197 commits in 3 months · bus factor 4
- License
- Apache-2.0Permissive · OSI-approved
- Security
- No advisories publishedNothing published on GitHub
- Supported versions
- No scheduleendoflife.date does not track this project
26.1k stars · 1.4k forks · 536 open issues · last release 3 days ago · data checked 5 hours ago
Release history
All releases on GitHubAtom feed/feed/biomejs/biome
Badge
[](/p/biomejs/biome)
Biome CLI v2.6.7
2.6.7
Patch Changes
- #12906
b3375d2Thanks @dyc3! - Added the nursery rulenoAsyncPromiseFinally, 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();
});
- #12894
e24da6fThanks @dyc3! - Added the nursery rulenoDuplicateTypeConstituents, which reports types listed more than once in a union or intersection type, andundefinedin the type of an optional parameter.
type T = string | number | string;
function f(a?: string | undefined) {}
- #12899
6c15027Thanks @dyc3! - Added the nursery rulenoExcessiveSelectorComplexity, 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
0b8f429Thanks @dyc3! - Added the new nursery rulenoInvalidFetchOptions, which reports abodyin the options offetch()andnew Request()when the method isGETorHEAD. These calls throw aTypeErrorat runtime. When nomethodis given, the request usesGET.
await fetch("/", { method: "GET", body: "foo=bar" });
- #12926
9b6b9f4Thanks @dyc3! - Added the nursery rulenoNewArray, which reportsnew 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
739440fThanks @dyc3! - Added the new nursery rulenoRedundantTypeConstituents, which reports members of union and intersection types that have no effect, such as a literal type next to its primitive type, orneverin a union.
type Status = "active" | string;
- #12810
71ab61bThanks @dyc3! - Added the nursery rulenoSvelteAsyncStore, which disallows passing async functions to thewritable(),readable(), andderived()stores fromsvelte/store.
import { writable } from "svelte/store";
const user = writable(null, async (set) => {
set(await fetchUser());
});
- #12917
37d9f41Thanks @dyc3! - Added the new nursery rulenoUnresolvedDefaultImport, which reports default imports from modules that have no default export. The rule is part of theprojectdomain.
// foo.js only contains `export function foo() {}`
import foo from "./foo.js";
- #12892
f16842eThanks @dyc3! - Added the nursery rulenoUselessFallbackInSpread, which reports empty object fallbacks when spreading a value into an object. Spreadingnull,undefined, or another falsy value into an object adds no properties, so the fallback has no effect.
const object = { ...(options || {}) };
- #12785
c198be2Thanks @dyc3! - Added the new nursery rulenoUselessParameterPropertyAssignment, which reports constructor assignments such asthis.name = namewhennameis 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
a4d1b0fThanks @dyc3! - Added the nursery rulenoUselessSpread, which reports spread syntax that has no effect. For example,[first, ...[second]]can be written as[first, second], andnew Set([...items])can be written asnew Set(items).
- #12902
d7d755bThanks @dyc3! - Added the nursery rulenoVueExposeAfterAwait, which reportsexpose()anddefineExpose()calls that come after anawaitin 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
d33e56eThanks @dyc3! - Added the nursery ruleuseAtomicUpdates, which reports assignments in async functions and generators that can be based on an outdated value because the function paused at anawaitoryieldafter reading it.
let total = 0;
async function addToTotal(getAmount) {
total += await getAmount(); // reported
}
- #12901
48e3572Thanks @dyc3! - Added the new nursery ruleuseConsistentBooleanName. It requires variables, parameters, and functions that hold or return a boolean to start with a prefix such asisorhas, and reports names with those prefixes that don't hold or return a boolean.
const completed = progress === 100;
const hasName = "Sindre";
- #12905
5b00387Thanks @dyc3! - Added the nursery ruleuseConsistentFontWeightNotation, which enforces writing font weights either as numbers or as the keywordsnormalandboldwhere possible. It checks thefont-weightandfontproperties, and its safe fix converts betweennormal/boldand400/700.
a { font-weight: bold; }
- #12922
8d33c85Thanks @dyc3! - Added the nursery ruleuseConsistentTupleLabels, which reports tuple type elements without a label when other elements of the same tuple have one.
type Point = [x: number, number];
- #12925
7252cbdThanks @dyc3! - Added the new nursery ruleuseGlobalRegexInMatchAll, which reports calls tomatchAll()with a regular expression that doesn't have thegflag. These calls throw aTypeErrorat runtime.
text.matchAll(/pattern/);
- #12891
e781bc3Thanks @dyc3! - Added the nursery ruleuseGlobalRegexInReplaceAll, which reports regular expressions without thegflag passed toreplaceAll(). These calls throw aTypeErrorinstead of replacing text.
withSpaces.replaceAll(/\s+/, ",");
- #12896
a968e1aThanks @dyc3! - Added the new nursery ruleuseValidCharacterComparison, which reports comparisons between a single character and a string that has more than one character. Such comparisons are alwaysfalse, or alwaystruewith!==and!=.
text.charAt(0) === "ab";
- #13085
7a795d0Thanks @ematipico! - Fixed withastro/compiler-rs#221 so Astro template expressions containing comment-only JSX expression children, such as{}, parse without diagnostics.