Version History
Version 2.6.4 Latest
Patch Changes
-
#12261
19fbfb2Thanks @dyc3! - Added the new nursery rulenoConsoleSpaces, which reports a leading or trailing space in aconsole.log(),console.debug(),console.info(),console.warn(), orconsole.error()argument that sits next to another argument. These methods already put a space between arguments, so such a space prints twice.console.log("abc ", "def"); -
#12469
cd716d3Thanks @dyc3! - Added the new nursery rulenoMagicArrayFlatDepth, which reports number literals other than1passed as the depth ofArray.prototype.flat()unless a comment inside the parentheses explains them.const items = array.flat(2); -
#12470
92c9e81Thanks @dyc3! - Added the nursery rulenoNull, which reports uses of thenullliteral and suggestsundefinedinstead. Strict comparisons such asfoo === nullare allowed.let foo = null; -
#12483
9bd3527Thanks @dyc3! - Added the nursery rulenoReturnArrayPush, which reports code that uses the return value ofpush()orunshift(). These methods return the new length of the array, not the added item or the array.function add(item) {return items.push(item);} -
#12477
a384892Thanks @dyc3! - Added the nursery rulenoUnreadableIife, which reports arrow functions that are called right where they are defined and whose body is wrapped in parentheses.const foo = (bar => (bar ? bar.baz : baz))(getBar()); -
#12447
0a963e4Thanks @dyc3! - Added the nursery rulenoUselessRecursion, which reports functions that return a call to themselves when a loop can do the same work. Too many nested calls can crash the program with a stack overflow error.function findRoot(node) {if (node.parent) {return findRoot(node.parent);}return node;} -
#12554
2eddda9Thanks @dyc3! - Added the nursery rulenoVueComputedPropertiesInData, which reports computed properties used inside thedatafunction of a Vue component. Vue runsdatabefore it sets up computed properties, so the value read there isundefined.<script>export default {data() {return { total: this.doubled };},computed: {doubled() {return 2;},},};</script> -
#12586
824df15Thanks @dyc3! - Added the nursery rulenoVueDeprecatedDeleteSet, which reports calls to the$setand$deletefunctions,Vue.setandVue.delete, andsetanddelimported fromvue. Vue 3 removed these functions, so calling them throws an error.<script>export default {mounted() {this.$set(this.user, "name", "Alice");},};</script> -
#12648
6fc1a51Thanks @dyc3! - Added the nursery rulenoVueDeprecatedRouterLinkTagProp, which disallows thetagprop onRouterLink. Vue Router 4 ignores this prop, so the link still renders as an<a>element.<template><RouterLink tag="li" to="/">Home</RouterLink></template> -
#12631
de1188fThanks @dyc3! - Added the new nursery rulenoVueDeprecatedScopeAttribute, which reports thescopeattribute on<template>elements in Vue files. Vue no longer supports this attribute, so usev-slotto receive slot props instead.<template><ListComponent><template scope="props">{{ props.title }}</template></ListComponent></template> -
#12562
5d7553bThanks @dyc3! - Added the new nursery rulenoVueMultipleSlotArgs, which disallows passing more than one argument to a Vue slot from a render function. Slot content written in a template receives only the first argument.<script>export default {render() {return this.$slots.default(item, index); // reported},};</script> -
#12513
2e520d8Thanks @dyc3! - Added the nursery rulenoVueMutatingProps, which reports code that changes the props of a Vue component, in the script or in the template. Props belong to the parent component, so the child should emit an event or copy the value instead.<script setup>const props = defineProps({ items: Array });props.items.push("new item");</script> -
#12567
144b786Thanks @dyc3! - Added the nursery rulenoVueSideEffectsInComputed, which reports Vue computed properties that change state. Vue decides when to run a computed property, so changes made inside one happen at unpredictable times.<script setup>import { computed, ref } from "vue";const items = ref([]);// `reverse()` changes `items.value` in place.const reversedItems = computed(() => items.value.reverse());</script> -
#12603
861b288Thanks @dyc3! - Added the new nursery rulenoVueUnusedRefs, which reports template refs in Vue components that nothing reads through$refs,useTemplateRef(), or a variable of the same name in<script setup>. The rule needshtml.experimentalFullSupportEnabledto betrue.<template><input ref="input" /></template> -
#12285
68770e0Thanks @dyc3! - Added the new nursery rulenoYamlBooleanKeys, which disallows boolean values as keys in YAML. For example, the following key is a boolean instead of text, so it is reported:true: enabled -
#12338
f46411bThanks @dyc3! - Added the nursery ruleuseSvelteEventDispatcherTypes, which reportscreateEventDispatcher()calls that don’t declare the types of their events in Svelte components written in TypeScript.The rule accepts a call that declares its events:
<script lang="ts">import { createEventDispatcher } from "svelte";const dispatch = createEventDispatcher<{ save: string }>();</script> -
#12615
ade9845Thanks @dyc3! - Added the nursery ruleuseVueDefineOptions, which reports the default export of a plain<script>block in Vue components that also use<script setup>, and suggests setting those options withdefineOptions()instead.<script>export default { name: "MyComponent" }; // reported</script><script setup>const props = defineProps(["title"]);</script> -
#12514
e74b4dcThanks @dyc3! - Added the nursery ruleuseVueDefinePropsDestructuring, which requires destructuring the props returned bydefineProps()in Vue<script setup>blocks. It also reportswithDefaults(), because destructured props can set their default values directly.<script setup lang="ts">const props = defineProps<{ foo?: string }>();</script> -
#12559
94985baThanks @dyc3! - Added the nursery ruleuseVueTemplateRef, which requiresuseTemplateRef()instead ofref()orshallowRef()to access elements of the template in<script setup>.<template><input ref="input" /></template><script setup>import { ref } from "vue";const input = ref(); // reported</script> -
#12512
6be5078Thanks @dyc3! - Added the nursery ruleuseVueTypedProps, which reports Vue props declared without a type, in thepropsoption,defineProps(), ordefineModel(). Without a type, Vue accepts any value for the prop and can’t warn when a component receives the wrong kind of value.<script setup>defineProps(["title"]);</script> -
#12653
f307633Thanks @dyc3! - Added the nursery ruleuseVueVModel, which reports a prop binding on a Vue component paired with anupdate:listener that only writes the new value back, and suggestsv-modelinstead.<template><MyComponent :title="title" @update:title="title = $event" /></template> -
#12591
a810209Thanks @dyc3! - Added the nursery ruleuseVueValidDefineEmits, which enforces valid usage of Vue’sdefineEmitsmacro in<script setup>.For example, the following code is now reported, because
defineEmitsdeclares its events with both a type and an argument:<script setup lang="ts">const emit = defineEmits<(e: "notify") => void>(["submit"]);</script> -
#12614
9308110Thanks @dyc3! - Added the nursery ruleuseVueValidDefineProps, which reportsdefineProps()calls that Vue can’t compile or that declare props incorrectly. For example, it reports a component that callsdefineProps()twice, or whosedefineProps()argument uses a variable declared in<script setup>:<script setup>const definition = { msg: String };defineProps(definition);</script> -
#12570
222a230Thanks @dyc3! - Added the nursery ruleuseVueValidVIs, which reportsv-isdirectives that have an argument or modifiers, have no value, or are used on a component instead of a native HTML element.For example, the following
v-isdirective has no value:<template><tr v-is></tr></template> -
#12521
4010bb7Thanks @dyc3! - Added the nursery ruleuseVueValidVMemo, which reports invalidv-memodirectives in Vue templates. Av-memodirective must have an array value, can’t have an argument or modifiers, and doesn’t work inside an element withv-for.For example, the following value is an object instead of an array:
<template><div v-memo="{ id }"></div></template> -
#12597
aff42a7Thanks @dyc3! - Added the nursery ruleuseVueValidVModel, which reportsv-modeldirectives that Vue can’t use: on unsupported elements or file inputs, with an argument or unknown modifier on a native element, without a value, or with a value that can’t be assigned to.For example, the following
v-modeldirectives are invalid:<template><div v-model="foo"></div><input v-model="foo + bar" /></template> -
#12569
3058597Thanks @dyc3! - Added the new nursery ruleuseVueValidVShow, which reportsv-showdirectives that have an argument, a modifier, or no value, or that are placed on a<template>element.<template v-show="isVisible"><div></div></template> -
#12525
e2e5a36Thanks @dyc3! - Added the nursery ruleuseVueValidVSlot, which reports misplaced, duplicated, or malformedv-slotdirectives in Vue templates.For example, the rule reports two
<template>elements that fill the same slot:<MyComponent><template #header>First title</template><template #header>Second title</template></MyComponent> -
#12472
efd16bdThanks @dyc3! - Added the new nursery ruleuseWhileLoopCondition, which reports loops such aswhile (true)andfor (;;)that start with anifstatement containing only abreak, and moves that condition into thewhilestatement.while (true) {if (!hasMore()) {break;} // reportedprocessNext();} -
#12640
167bb00Thanks @latin-1! - UpdateduseSortedPropertiesto followstylelint-config-recess-order7.9.0, adding sorting support forscroll-behavior, anchor positioning, multi-column layout, and other properties known to Biome. -
#12719
40a82b0Thanks @dyc3! - Improved the performance of the linter. Biome now spends less time setting up the enabled rules for each file it analyzes. -
#12722
f074730Thanks @dyc3! - Improved the performance ofbiome lintby about 1% to 3% on large projects, most noticeably with Biome’s default rules and with rules that track variables or unreachable code. -
#12501
90a4d74Thanks @ematipico! - Fixed #12466: the Biome daemon used more memory with everybiome check --use-serverrun. The daemon now reuses the data that it stores for each file and project, and it keeps syntax trees only for the files that it read most recently. -
#12501
90a4d74Thanks @ematipico! - Fixed biomejs/biome-vscode#923: when a file open in the editor changed on disk, the language server replaced the editor’s text with the text on disk. Biome now keeps the editor’s text of open files until they are closed, so diagnostics, code actions and formatting stay at the right positions. -
#12652
59ff42aThanks @kurovskyiii! - Fixed #12651: an imported name that the other module exports as both a type and a value now resolves to the type in type annotations, sonoBaseToStringno longer reportsslugbelow as an object.rule-slug.ts export type RuleSlug = string;export const RuleSlug = { create: (text: string): RuleSlug => text } as const;// main.tsimport { RuleSlug } from "./rule-slug";export const label = (slug: RuleSlug): string => `rule ${slug}`; -
#12678
301402fThanks @nhedger! - Fixed biomejs/biome-vscode#1113: the language server now shows a warning when the configuration file can’t be parsed. Previously, Biome stopped processing files without telling the user why. -
#12662
8c836ebThanks @dyc3! - Fixed #12645: the Markdown formatter no longer removes the blank line between a blockquote and the list that follows it, matching Prettier.> A note.- one- two -
#12662
8c836ebThanks @dyc3! - Fixed #12663: the Markdown formatter no longer removes the blank line between a table and the list that follows it, matching Prettier.| Table || ----- || Value |- Hello -
#12576
735d370Thanks @jfmcdowell! - Fixed #12541: Markdown list items whose markers are indented 4 or more spaces now nest at the correct level. Previously the formatter could move such an item under the item before it, or join it to that item’s text.1. Step- a- x- y- b- y- b -
#12575
0da9080Thanks @jfmcdowell! - Fixed formatting of Markdown block quotes inside deeply indented list items. WithproseWrap: "always", consecutive quote lines now wrap together within the same quote, while setext headings and fenced code blocks keep their structure.10. item> first line> second line> first line second line -
#12607
896d53eThanks @xucian! - Fixed #12542: the Markdown formatter is no longer idempotent when it formats tables.| a | b || -------- | ----- || x | `y` z || `p` z`q` | r || a | b || --------- | ----- || x | `y` z || `p` z `q` | r | -
#12692
8ff63f4Thanks @NikitaCOEUR! - Fixed thelinux-x64-muslbinary not using jemalloc, which it already ships: it fell back to musl’s allocator, andbiome checkon several threads could take minutes instead of seconds, for example in Alpine-based CI images. -
#12682
fa7cf4cThanks @dyc3! - Fixed #12679: whenmarkdown.parser.frontmatterandmarkdown.formatter.formatEmbedsare enabled, the Markdown formatter keeps the frontmatter of a fenced Markdown code block as written. Previously, it formatted the frontmatter as a thematic break and a paragraph, which removed the indentation of its YAML.```markdown---verified:by: human---# Policy``` -
#12649
343c8caThanks @JamBalaya56562! - Fixed #12643 and #12669: Biome now migrates the Prettier optionbracketSpacingtoformatter.bracketSpacing, both at the top level and insideoverrides. JSON and GraphQL files are now formatted with the same bracket spacing as JavaScript files. -
#12640
167bb00Thanks @latin-1! - FixeduseSortedPropertiesto withhold sorting fixes that would change the effective values of overlapping declarations, physical/logical border or corner properties, or declarations followed byall. UpdatednoShorthandPropertyOverridesto recognize logical border, corner shape,position-try,text-box, andtransition-behavioroverrides. -
#12723
b6cbec8Thanks @dyc3! - Improved the performance ofbiome lint,biome check, andbiome cion files where rules report diagnostics with code fixes, by up to 12% with the default rules. -
#12664
6021da0Thanks @MindTooth! - Fixed Biome processingpnpm-lock.yamlfiles. These generated lockfiles are now protected from processing. -
#12501
90a4d74Thanks @ematipico! - Fixed an issue where the CLI, when it ran with--use-serveralongside an editor connected to the same daemon, checked the unsaved text of the files open in the editor instead of the files on disk, and could make the editor’s text get lost. The CLI now checks the files on disk, and every editor and CLI run connected to the daemon keeps its own text of the files it opens. -
#12519
9ae56baThanks @dyc3! - The rulenoVueVIfWithVFornow also reportsv-else-ifandv-elseon the same element asv-for.<div v-if="loading">Loading...</div><TodoItem v-else v-for="todo in todos" :todo="todo" /> -
#12702
df0f7ccThanks @dyc3! - Fixed parsing of default values in Vuev-forbindings. Biome now parses the default value as JavaScript, so it is formatted and linted like other template expressions instead of being reported as a parse error.<div v-for="{ value = gt('v-for default') } in rows" /> -
#12656
25a00a2Thanks @dyc3! - Fixed non-JSON files inside the global settings directories of Zed, VS Code, and Cursor being parsed as JSON. -
#12501
90a4d74Thanks @ematipico! - Fixed an issue where the language server kept using the previous parser options for open files after the configuration changed. Open files are now parsed again with the new options, for examplejson.parser.allowComments. -
#12656
25a00a2Thanks @dyc3! - Improved the performance of Biome when it processes many files by up to 7%. -
#12661
066a077Thanks @dyc3! - Added the nursery rulenoVueDeprecatedListeners. It reports references to$listeners, which Vue 3 removed, in Vue templates and component objects. For example, Biome now reports<div v-on="$listeners" />andthis.$listenersinside a Vue component.
Copyright (c) 2023-present Biome Developers and Contributors.