You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#13080a68137d 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.
newBuffer(5);
#1296682651f5 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
#129240a9d204 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);
#129076f2635a 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.
#1290404f30c4 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.
#128935d7ca32 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" />
#12561746c421 Thanks @dyc3! - Added the nursery rule noVueAsyncComputed, which reports asynchronous code in Vue computed properties, such as async functions, await, promises, setTimeout(), and nextTick().
#12964149d729 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.
#125450bbe4f1 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.
#125803fdc987 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.
#13063d4e90c8 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.
#13082c1c8c85 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();
#13075acfeaf9 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);
#13076cf5b1a6 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);
#130205d28641 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"
}
#13079058d7a1 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);
#13081be58f67 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.
#130544d81f0d 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.
#13058ae251e4 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.
#12965c33c03d 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.
#12145596a2b1 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.
#12935e506ff1 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.
#13181e1556ae 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:
#131301b350ed 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>;.
#130544d81f0d 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.
#12602d5da394 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` .
#13181e1556ae 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:
#12845e3ab04d 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:.
#13131a788cac 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.
// Beforefor(lethas=function(k){returnkincache;};;){}// After the fixfor(lethas=(k)=>(kincache);;){}
#128408908627 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.
constMAX=2n**62n-1n;constclamp=(x)=>(x>MAX ? MAX : x);
When defineComponent() receives both a function and an options object, these rules now ignore the setup option, because Vue runs the function instead.
#1315261924f6 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.
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").
#13123e7c8297 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).
#1205987784c7 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.
#13151be372b5 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.
#1205987784c7 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.
typeUnwrap<T>=TextendsPromise<infer U> ? U : T;// Previously inferred as `unknown | Promise<number>`, now as `number`.typeValue=Unwrap<Promise<number>>;
#12602d5da394 Thanks @dyc3! - Biome now reports an error when a GritQL plugin file name contains invalid characters that could conflict with Biome suppressions.
#1283881d8d28 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.
<divclassName="hover:bg-green-500 float-left"/>;// both classes are reported
#1293268e6887 Thanks @dyc3! - Improved the performance of linting files that have no suppression comments by up to 61%.
#13136dcb1eab Thanks @dyc3! - Improved the performance of linting JavaScript and HTML files when Tailwind rules are enabled.
#13094ae66383 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>
#13162854ff15 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.
#1205987784c7 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.
#12906b3375d2 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()=>{awaitcleanup();});
#12894e24da6f Thanks @dyc3! - Added the nursery rule noDuplicateTypeConstituents, which reports types listed more than once in a union or intersection type, and undefined in the type of an optional parameter.
#128996c15027 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{}
#128970b8f429 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.
awaitfetch("/",{method: "GET",body: "foo=bar"});
#129269b6b9f4 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.
constarray=newArray(length);
#12895739440f 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.
typeStatus="active"|string;
#1281071ab61b Thanks @dyc3! - Added the nursery rule noSvelteAsyncStore, which disallows passing async functions to the writable(), readable(), and derived() stores from svelte/store.
#1291737d9f41 Thanks @dyc3! - Added the new nursery rule noUnresolvedDefaultImport, which reports default imports from modules that have no default export. The rule is part of the project domain.
// foo.js only contains `export function foo() {}`importfoofrom"./foo.js";
#12892f16842e 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.
constobject={ ...(options||{})};
#12785c198be2 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.
#12900a4d1b0f 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).
#12902d7d755b 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.
#12596d33e56e 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.
#1290148e3572 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.
#129055b00387 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;}
#129228d33c85 Thanks @dyc3! - Added the nursery rule useConsistentTupleLabels, which reports tuple type elements without a label when other elements of the same tuple have one.
typePoint=[x: number,number];
#129257252cbd 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/);
#12891e781bc3 Thanks @dyc3! - Added the nursery rule useGlobalRegexInReplaceAll, which reports regular expressions without the g flag passed to replaceAll(). These calls throw a TypeError instead of replacing text.
withSpaces.replaceAll(/\s+/,",");
#12896a968e1a 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";
#130857a795d0 Thanks @ematipico! - Fixed withastro/compiler-rs#221 so Astro template expressions containing comment-only JSX expression children, such as <span>{<!-- x -->}</span>, parse without diagnostics.
#130337638393 Thanks @GBra-4-669! - Fixed #12980: the CSS parser no longer panics on a composes declaration whose value contains a non-identifier token, such as composes: 1px;. It reports a diagnostic instead.
#1291737d9f41 Thanks @dyc3! - Fixed noUnresolvedImports: it now reports default imports from modules that only forward exports with export * from "...". export * never re-exports a default export, so import foo from "./barrel.js" fails when ./barrel.js contains only export * from "./foo.js".
#12596d33e56e Thanks @dyc3! - Fixed noUnreachableSuper ignoring the default values of constructor parameters. Using this in a default value is now reported, because it runs before super(), and calling super() in a default value is now recognized.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: Cargo.lock
Updating git repository `https://github.com/biomejs/biome`
From https://github.com/biomejs/biome
* [new ref] 2460d16236ec2106d2c496f628a6041efb376019 -> refs/commit/2460d16236ec2106d2c496f628a6041efb376019
Updating crates.io index
error: failed to select a version for `serde_json`.
... required by package `biome_diagnostics v0.7.3 (https://github.com/biomejs/biome?rev=2460d16236ec2106d2c496f628a6041efb376019#2460d162)`
... which satisfies git dependency `biome_diagnostics` of package `astro2tsx v0.1.0 (/tmp/renovate/repos/github/withastro/compiler-rs/crates/astro2tsx)`
versions that meet the requirements `^1.0.154` are: 1.0.154
all possible versions conflict with previously selected packages
previously selected package `serde_json v1.0.151`
... which satisfies dependency `serde_json = "^1"` (locked to 1.0.151) of package `astro2tsx v0.1.0 (/tmp/renovate/repos/github/withastro/compiler-rs/crates/astro2tsx)`
failed to select a version for `serde_json` which could resolve this conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
2.5.14→2.6.84eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d164eadd57→2460d16Release Notes
biomejs/biome (@biomejs/biome)
v2.6.8Compare Source
Patch Changes
#13080
a68137dThanks @dyc3! - Added the nursery rulenoBufferConstructor, which disallows the deprecated Node.jsBuffer()andnew Buffer()constructors. UseBuffer.from(),Buffer.alloc(), orBuffer.allocUnsafe()instead.#12966
82651f5Thanks @dyc3! - Added the nursery rulenoConfusingArraySplice, which reportssplice()andtoSpliced()calls that replace a single element or insert at index-1.#12924
0a9d204Thanks @dyc3! - Added the nursery rulenoDynamicRequire, which disallowsrequire()calls whose module name is built at runtime. When thecheckDynamicImportsoption is enabled, the rule also checksimport()calls.#12907
6f2635aThanks @dyc3! - Added the nursery rulenoLateCurrentTargetAccess, which reports reads ofevent.currentTargetthat run after the browser has finished handling the event, whencurrentTargetisnull.#12904
04f30c4Thanks @dyc3! - Added the nursery rulenoMisusedSpread, 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.#12893
5d7ca32Thanks @dyc3! - Added the nursery rulenoTripleSlashReference, which reports/// <reference path="..." />comments and/// <reference types="..." />comments for packages that the file also imports. Thelib,path, andtypesoptions control which kinds of references are allowed./// <reference path="./globals.d.ts" />#12561
746c421Thanks @dyc3! - Added the nursery rulenoVueAsyncComputed, which reports asynchronous code in Vue computed properties, such asasyncfunctions,await, promises,setTimeout(), andnextTick().#12964
149d729Thanks @dyc3! - Added the nursery rulenoVueDefineModelDefault, which disallows thedefaultoption in Vue'sdefineModel(). When a parent component passesundefinedwithv-model, the child component uses the default value while the parent keepsundefined, so the two components show different values.#13060
67bc9d5Thanks @dyc3! - Added the nursery rulenoVueDeprecatedFilter, which reports the filter syntax that Vue 3 removed.For example, the following template uses the
currencyfilter:#12545
0bbe4f1Thanks @dyc3! - Added the new nursery rulenoVueDeprecatedVIs, which reports the deprecated Vuev-isdirective. Use theisattribute with avue:prefix instead.#12580
3fdc987Thanks @dyc3! - Added the nursery rulenoVueExportInScriptSetup, which disallowsexportin Vue<script setup>blocks. Vue fails to compile a component when its<script setup>block exports a value. TypeScript type exports are allowed.#13063
d4e90c8Thanks @dyc3! - Added the nursery rulenoYamlEmptyMapKeys, which reports YAML map entries whose key is missing, or has only a tag or an anchor. The rule is recommended.: value#13061
97aa183Thanks @dyc3! - Added the nursery rulenoYamlEmptyMapValues, which reports keys in YAML maps that have no value.name:#13062
6aad75fThanks @dyc3! - Added the new nursery rulenoYamlEmptySequenceEntries, which reports empty items in YAML lists.#13082
c1c8c85Thanks @dyc3! - Added the nursery ruleuseCalledWith, which reportstoHaveBeenCalled(),toBeCalled(), andtoHaveBeenCalledOnce()assertions, because they don't check the arguments that the function was called with. The rule belongs to thetestdomain.#13075
acfeaf9Thanks @dyc3! - Added the nursery ruleuseExpectToHaveBeenCalled, which reports tests that compare the number of calls of a mock function to zero, and suggests usingtoHaveBeenCalled()instead.#13076
cf5b1a6Thanks @dyc3! - Added the nursery ruleuseExpectToHaveBeenCalledTimes, which reports tests that check the length ofmock.callswithtoHaveLength(), and suggests usingtoHaveBeenCalledTimes()instead.#13020
5d28641Thanks @dyc3! - Added the new nursery ruleusePackageJsonValidLicense, which reports alicensefield inpackage.jsonthat isn't a valid license. The rule accepts SPDX license identifiers and expressions,UNLICENSED, and references to a license file such asSEE LICENSE IN LICENSE.md.For example, the rule reports the following
package.jsonfile becauseGPL3isn't an SPDX license identifier:{ "name": "my-package", "license": "GPL3" }#13079
058d7a1Thanks @dyc3! - Added the nursery ruleuseSpyOn, which reports properties that are overwritten withjest.fn()orvi.fn(). Overwriting a property loses its original value, whilejest.spyOn()andvi.spyOn()keep it so it can be restored after the test.#13081
be58f67Thanks @dyc3! - Added the nursery ruleuseTopLevelRequire, which reportsrequire()calls that aren't at the top level of the module, such as calls inside functions, blocks, ortrystatements.#13054
4d81f0dThanks @dyc3! - Added the nursery ruleuseValidNamespaceImports, 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.#13058
ae251e4Thanks @dyc3! - Added the new nursery ruleuseVueConsistentVOnHandlerStyle, which enforces one style of event handler in Vuev-ondirectives. By default, it prefers the name of a method, and an inline function where a method name can't be used.#12965
c33c03dThanks @dyc3! - Added the nursery ruleuseVueRegisteredComponentNameCasing, which requires the names of components registered in thecomponentsoption of a Vue component to use one casing style. By default, names must be in PascalCase. Thecasingoption switches the rule to camelCase or kebab-case.#12145
596a2b1Thanks @ematipico! - Added type narrowing for unwritten locallet/constvariables and parameters aftertypeof, equality, nullish, and truthiness checks. Type-aware rules now use these refinements in branches, short-circuit expressions, and after early returns, includingnoUnnecessaryConditionsandnoFloatingPromises. Types such as{}no longer imply that a value is always truthy.#12935
e506ff1Thanks @dyc3! - Improved the performance of the rulesnoRedeclareandnoUnsafeDeclarationMerging.biome lintwith Biome's default rules is now about 3% to 5% faster on large projects, and up to 11% faster on some TypeScript projects.#13181
e1556aeThanks @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:#13130
1b350edThanks @dyc3! - Fixed #13107: the unsafe fix ofnoDistractingElementsnow 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 asconst Ticker = () => <marquee>News</marquee>;.#13054
4d81f0dThanks @dyc3! - FixednoUnresolvedImportsreporting names that a module re-exports from a CommonJS module or from a file that isn't JavaScript, such asexport { foo } from "./legacy.cjs". The rule now also reports default imports from a module that only re-exports another module withexport * from, becauseexport * fromdoesn't forward the default export.#12602
d5da394Thanks @dyc3! - Fixed #12600:biome lint --suppressnow adds suppression comments for diagnostics emitted by plugins, such as// biome-ignore lint/plugin/noFoo: ignored using `--suppress`.#13097
3be9e3dThanks @ashokram-si! - Fixed #13064: ThenoUnknownTypeSelectorrule now correctly accepts the valid<selectedcontent>HTML element used in customizable select controls.#13181
e1556aeThanks @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
e3ab04dThanks @dyc3! - Fixed the location of Tailwind CSS diagnostics reported on unquoted object keys. Inclsx({ shadow: active }), diagnostics now highlightshadowinstead of starting one character later athadow:.#13098
d3be626Thanks @ashokram-si! - Fixed #13084: TheuseThisInClassMethodsrule now correctly recognizesthiswhen used inside parameter default values for methods, setters, and class fields.#13131
a788cacThanks @dyc3! - Fixed #13129: the fix ofuseArrowFunctionno longer produces invalid code when the function is in the initializer of aforstatement and returns aninexpression. The arrow function body is now wrapped in parentheses.#12840
8908627Thanks @dyc3! - Fixed #12796:useMathMinMaxno longer reports comparisons with abigintwritten as an expression, such as-1nor2n ** 62n - 1n, or with aconstvariable initialized with one. Its unsafe fix turned these comparisons intoMath.min()orMath.max()calls, which throw aTypeErrorwhen given abigint.#13152
61924f6Thanks @dyc3! - FixednoVueWatchAfterAwait,noVueLifecycleAfterAwaitandnoVueRestrictedCallAfterAwait, which now also check thesetup()function passed as the first argument ofdefineComponent(). The following code is now reported:When
defineComponent()receives both a function and an options object, these rules now ignore thesetupoption, because Vue runs the function instead.#13152
61924f6Thanks @dyc3! -noVueDuplicateKeysnow checks the properties returned by asetup()method of an options object, soreturn { foo }conflicts with a prop, data property, method or computed property namedfoo.#13152
61924f6Thanks @dyc3! - The Vue emit rules now read events declared with a function type, as indefineEmits<(e: "change", value: string) => void>(), and event names written as template literals without substitutions, as inemit(`change`).noVueUndeclaredEmits,noVueUnusedEmitDeclarations,useVueSingleEventPayloadanduseVueEmitValidatorpreviously skipped events declared in these forms.noVueShadowNativeEventsnow checksthis.$emit()only wherethisis the component, and no longer reports$emit()called through a variable that holdsthis, as inconst vm = this; vm.$emit("click").#12947
a54965dThanks @machadinhos! - Added the nursery rulenoDrizzleDbObjectInsideTransaction, which reports a Drizzle ORM instance used inside its own transaction callback instead of the transaction object.#13123
e7c8297Thanks @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,useAwaitThenableno longer reportsawait app.listen({ port: 0 })on a Fastify server, and still reportsawait app.listen({ port: 0 }, callback).#12059
87784c7Thanks @dyc3! - FixednoUnsafePlusOperandstreating the negation of abigintvalue as anumber. Code such as-value + 1n, wherevalueis declared asbigint, is no longer reported for mixingnumberandbigint.#13151
be372b5Thanks @dyc3! - Fixed Vue lint rules such asuseVueVModelanduseVueVOnExacttreating 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
87784c7Thanks @dyc3! - Type inference now evaluates conditional types such asT extends U ? X : Y, includinginferand distribution over unions, instead of treating them as a union of both branches. This also applies to built-in types such asExclude,Extract,ReturnType,Parameters, andAwaited, which improves the accuracy of type-aware rules such asnoFloatingPromises.#12602
d5da394Thanks @dyc3! - Biome now reports an error when a GritQL plugin file name contains invalid characters that could conflict with Biome suppressions.#12838
81d8d28Thanks @dyc3! - Added the nursery rulenoTailwindRestrictedClassesfor 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." } } } } } } }#12932
68e6887Thanks @dyc3! - Improved the performance of linting files that have no suppression comments by up to 61%.#13136
dcb1eabThanks @dyc3! - Improved the performance of linting JavaScript and HTML files when Tailwind rules are enabled.#13094
ae66383Thanks @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
854ff15Thanks @Punisheroot! - Fixed #13125:noUselessThisAliasno longer reports aliases used in instance and static class field initializers, where replacing the alias withthischanges which object is accessed.#12059
87784c7Thanks @dyc3! - Fixed type inference for the intersection of a primitive type and one of its literal types, such asstring & "a", which Biome inferred asneverinstead of"a". Type-aware rules such asuseExhaustiveSwitchCasesandnoFloatingPromisesnow see the literal, so the following switch is reported for missing the"a"case.#12551
ca039a1Thanks @pkallos! - Fixed #9842:useNullishCoalescingno longer skips||and||=inside a call to a locally declaredBooleanwhenignoreBooleanCoercionis enabled.v2.6.7Compare Source
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.#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.#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:#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.#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.#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.#12810
71ab61bThanks @dyc3! - Added the nursery rulenoSvelteAsyncStore, which disallows passing async functions to thewritable(),readable(), andderived()stores fromsvelte/store.#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.#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.#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.#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.#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.#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.#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.#12922
8d33c85Thanks @dyc3! - Added the nursery ruleuseConsistentTupleLabels, which reports tuple type elements without a label when other elements of the same tuple have one.#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.#12891
e781bc3Thanks @dyc3! - Added the nursery ruleuseGlobalRegexInReplaceAll, which reports regular expressions without thegflag passed toreplaceAll(). These calls throw aTypeErrorinstead of replacing text.#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!=.#13085
7a795d0Thanks @ematipico! - Fixed withastro/compiler-rs#221 so Astro template expressions containing comment-only JSX expression children, such as<span>{<!-- x -->}</span>, parse without diagnostics.#12621
79ce388Thanks @latin-1! - Fixed #12413 and #12414:useSortedPropertiesnow sorts consecutive groups of properties independently, preserving the positions of nested rules, at-rules, and SCSS variable declarations.#13065
bd9faaeThanks @ematipico! - Fixed #5848: runninguseSortedKeysoruseSortedSelectionSetas an editor source action no longer corrupts nested objects or selection sets.#13056
98f4d53Thanks @ematipico! - Fixed #10607:noUndeclaredDependenciesno longer reports imports resolved through TypeScript'scompilerOptions.pathsmappings.#13033
7638393Thanks @GBra-4-669! - Fixed #12980: the CSS parser no longer panics on acomposesdeclaration whose value contains a non-identifier token, such ascomposes: 1px;. It reports a diagnostic instead.#12917
37d9f41Thanks @dyc3! - FixednoUnresolvedImports: it now reports default imports from modules that only forward exports withexport * from "...".export *never re-exports a default export, soimport foo from "./barrel.js"fails when./barrel.jscontains onlyexport * from "./foo.js".#12596
d33e56eThanks @dyc3! - FixednoUnreachableSuperignoring the default values of constructor parameters. Usingthisin a default value is now reported, because it runs beforesuper(), and callingsuper()in a default value is now recognized.#12596
d33e56eThanks [@dyc3](https://rediConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.