Vai al contenuto
verdict:

Biome 2.6.8

digest

note: la sintesi e le note di rilascio sono in inglese

note: nessuna sintesi per questa release digest

Le release digest sono elencate senza una sintesi. Le note di rilascio originali di questa versione sono qui sotto.

release-notesgithub.com/biomejs/biome · 404 righe
  1. ## 2.6.8
  2. ### Patch Changes
  3. - [#13080](https://github.com/biomejs/biome/pull/13080) [`a68137d`](https://github.com/biomejs/biome/commit/a68137d85f375843f50e951b129e29f05f948640) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noBufferConstructor`](https://biomejs.dev/linter/rules/no-buffer-constructor/), which disallows the deprecated Node.js `Buffer()` and `new Buffer()` constructors. Use `Buffer.from()`, `Buffer.alloc()`, or `Buffer.allocUnsafe()` instead.
  4. ```js
  5. new Buffer(5);
  6. ```
  7. - [#12966](https://github.com/biomejs/biome/pull/12966) [`82651f5`](https://github.com/biomejs/biome/commit/82651f53420bdb71ec73d4470fb9bc83acb54a46) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noConfusingArraySplice`](https://biomejs.dev/linter/rules/no-confusing-array-splice/), which reports `splice()` and `toSpliced()` calls that replace a single element or insert at index `-1`.
  8. ```js
  9. array.splice(index, 1, element); // use `array[index] = element` instead
  10. ```
  11. - [#12924](https://github.com/biomejs/biome/pull/12924) [`0a9d204`](https://github.com/biomejs/biome/commit/0a9d2044b859b5fb1c651bffa6e5ed20e97d9b92) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noDynamicRequire`](https://biomejs.dev/linter/rules/no-dynamic-require/), which disallows `require()` calls whose module name is built at runtime. When the `checkDynamicImports` option is enabled, the rule also checks `import()` calls.
  12. ```js
  13. require("./locales/" + language);
  14. ```
  15. - [#12907](https://github.com/biomejs/biome/pull/12907) [`6f2635a`](https://github.com/biomejs/biome/commit/6f2635af88e671bc67d753eabed9c355c1e4ee55) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noLateCurrentTargetAccess`](https://biomejs.dev/linter/rules/no-late-current-target-access/), which reports reads of `event.currentTarget` that run after the browser has finished handling the event, when `currentTarget` is `null`.
  16. ```js
  17. element.addEventListener("click", async (event) => {
  18. await save();
  19. event.currentTarget.disabled = false;
  20. });
  21. ```
  22. - [#12904](https://github.com/biomejs/biome/pull/12904) [`04f30c4`](https://github.com/biomejs/biome/commit/04f30c4d45ebe4cd63ca7993d2d323e037f690d9) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noMisusedSpread`](https://biomejs.dev/linter/rules/no-misused-spread/), 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.
  23. ```ts
  24. declare function getUser(): Promise<{ name: string }>;
  25. const user = { ...getUser() };
  26. ```
  27. - [#12893](https://github.com/biomejs/biome/pull/12893) [`5d7ca32`](https://github.com/biomejs/biome/commit/5d7ca32a80f2a86c2794748aa03ada4ce9ad7652) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noTripleSlashReference`](https://biomejs.dev/linter/rules/no-triple-slash-reference/), 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.
  28. ```ts
  29. /// <reference path="./globals.d.ts" />
  30. ```
  31. - [#12561](https://github.com/biomejs/biome/pull/12561) [`746c421`](https://github.com/biomejs/biome/commit/746c4217ba5b0d39ae696e7932ca95dadad8dae0) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noVueAsyncComputed`](https://biomejs.dev/linter/rules/no-vue-async-computed/), which reports asynchronous code in Vue computed properties, such as `async` functions, `await`, promises, `setTimeout()`, and `nextTick()`.
  32. ```vue
  33. <script>
  34. export default {
  35. computed: {
  36. async user() {
  37. return fetchUser(this.userId);
  38. },
  39. },
  40. };
  41. </script>
  42. ```
  43. - [#12964](https://github.com/biomejs/biome/pull/12964) [`149d729`](https://github.com/biomejs/biome/commit/149d7290dff8abd6576ca2ac0364cbc50d31aba0) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noVueDefineModelDefault`](https://biomejs.dev/linter/rules/no-vue-define-model-default/), 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.
  44. ```vue
  45. <script setup>
  46. const model = defineModel({ type: String, default: "" });
  47. </script>
  48. ```
  49. - [#13060](https://github.com/biomejs/biome/pull/13060) [`67bc9d5`](https://github.com/biomejs/biome/commit/67bc9d5c29faf5e5c2652877b44cc99ea1a2b699) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noVueDeprecatedFilter`](https://biomejs.dev/linter/rules/no-vue-deprecated-filter/), which reports the filter syntax that Vue 3 removed.
  50. For example, the following template uses the `currency` filter:
  51. ```vue
  52. <template>
  53. <p>{{ price | currency }}</p>
  54. </template>
  55. ```
  56. - [#12545](https://github.com/biomejs/biome/pull/12545) [`0bbe4f1`](https://github.com/biomejs/biome/commit/0bbe4f1b0399f6790bd7112152178f21025b8c94) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noVueDeprecatedVIs`](https://biomejs.dev/linter/rules/no-vue-deprecated-v-is/), which reports the deprecated Vue `v-is` directive. Use the `is` attribute with a `vue:` prefix instead.
  57. ```vue
  58. <template>
  59. <div v-is="'MyComponent'"></div>
  60. </template>
  61. ```
  62. - [#12580](https://github.com/biomejs/biome/pull/12580) [`3fdc987`](https://github.com/biomejs/biome/commit/3fdc987f3de1216baed3b1e87f5fe0b9ee854ef0) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noVueExportInScriptSetup`](https://biomejs.dev/linter/rules/no-vue-export-in-script-setup/), 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.
  63. ```vue
  64. <script setup>
  65. export const message = "Hello";
  66. </script>
  67. ```
  68. - [#13063](https://github.com/biomejs/biome/pull/13063) [`d4e90c8`](https://github.com/biomejs/biome/commit/d4e90c8ec52e4313f6fd3a6da742e41717790fd3) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noYamlEmptyMapKeys`](https://biomejs.dev/linter/rules/no-yaml-empty-map-keys/), which reports YAML map entries whose key is missing, or has only a tag or an anchor. The rule is recommended.
  69. ```yaml
  70. : value
  71. ```
  72. - [#13061](https://github.com/biomejs/biome/pull/13061) [`97aa183`](https://github.com/biomejs/biome/commit/97aa1838863c7d70618879ec96cfa0d287fd08f0) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noYamlEmptyMapValues`](https://biomejs.dev/linter/rules/no-yaml-empty-map-values/), which reports keys in YAML maps that have no value.
  73. ```yaml
  74. name:
  75. ```
  76. - [#13062](https://github.com/biomejs/biome/pull/13062) [`6aad75f`](https://github.com/biomejs/biome/commit/6aad75fc66892ccaa9407b2eb85fd7dc09a8126e) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noYamlEmptySequenceEntries`](https://biomejs.dev/linter/rules/no-yaml-empty-sequence-entries/), which reports empty items in YAML lists.
  77. ```yaml
  78. fruits:
  79. - apple
  80. -
  81. - banana
  82. ```
  83. - [#13082](https://github.com/biomejs/biome/pull/13082) [`c1c8c85`](https://github.com/biomejs/biome/commit/c1c8c85c8cbe4719ea5c75cca3f0f4087e0ec01e) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useCalledWith`](https://biomejs.dev/linter/rules/use-called-with/), 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.
  84. ```js
  85. expect(sendEmail).toHaveBeenCalled();
  86. ```
  87. - [#13075](https://github.com/biomejs/biome/pull/13075) [`acfeaf9`](https://github.com/biomejs/biome/commit/acfeaf917acd1a2ef790c046cc1c1cae78e67693) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useExpectToHaveBeenCalled`](https://biomejs.dev/linter/rules/use-expect-to-have-been-called/), which reports tests that compare the number of calls of a mock function to zero, and suggests using `toHaveBeenCalled()` instead.
  88. ```js
  89. expect(sendEmail).toHaveBeenCalledTimes(0);
  90. ```
  91. - [#13076](https://github.com/biomejs/biome/pull/13076) [`cf5b1a6`](https://github.com/biomejs/biome/commit/cf5b1a63452a63cad8fc52bd148b7a12aa2acacf) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useExpectToHaveBeenCalledTimes`](https://biomejs.dev/linter/rules/use-expect-to-have-been-called-times/), which reports tests that check the length of `mock.calls` with `toHaveLength()`, and suggests using `toHaveBeenCalledTimes()` instead.
  92. ```js
  93. expect(onSave.mock.calls).toHaveLength(1);
  94. ```
  95. - [#13020](https://github.com/biomejs/biome/pull/13020) [`5d28641`](https://github.com/biomejs/biome/commit/5d286411d2330d925ddbb5413687f2b190aa72fd) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`usePackageJsonValidLicense`](https://biomejs.dev/linter/rules/use-package-json-valid-license/), 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`.
  96. For example, the rule reports the following `package.json` file because `GPL3` isn't an SPDX license identifier:
  97. ```json
  98. {
  99. "name": "my-package",
  100. "license": "GPL3"
  101. }
  102. ```
  103. - [#13079](https://github.com/biomejs/biome/pull/13079) [`058d7a1`](https://github.com/biomejs/biome/commit/058d7a133c354abc310a0cfceab332bb495a4c9a) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useSpyOn`](https://biomejs.dev/linter/rules/use-spy-on/), 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.
  104. ```js
  105. Date.now = jest.fn(() => 10);
  106. ```
  107. - [#13081](https://github.com/biomejs/biome/pull/13081) [`be58f67`](https://github.com/biomejs/biome/commit/be58f67ee304345e237c0c269f6a88c77fdaf99f) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useTopLevelRequire`](https://biomejs.dev/linter/rules/use-top-level-require/), which reports `require()` calls that aren't at the top level of the module, such as calls inside functions, blocks, or `try` statements.
  108. ```js
  109. function readFile(filename, callback) {
  110. const fs = require("fs");
  111. fs.readFile(filename, callback);
  112. }
  113. ```
  114. - [#13054](https://github.com/biomejs/biome/pull/13054) [`4d81f0d`](https://github.com/biomejs/biome/commit/4d81f0d51046b70267a27d137dd87c0ced3737d2) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useValidNamespaceImports`](https://biomejs.dev/linter/rules/use-valid-namespace-imports/), 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.
  115. ```js
  116. import * as utils from "./utils.js";
  117. utils.subtract(2, 1); // `./utils.js` doesn't export `subtract`
  118. ```
  119. - [#13058](https://github.com/biomejs/biome/pull/13058) [`ae251e4`](https://github.com/biomejs/biome/commit/ae251e4f6f92b63ccd59a0a983e072e52ad69af8) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useVueConsistentVOnHandlerStyle`](https://biomejs.dev/linter/rules/use-vue-consistent-v-on-handler-style/), 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.
  120. ```vue
  121. <template>
  122. <button @click="save()">Save</button>
  123. </template>
  124. ```
  125. - [#12965](https://github.com/biomejs/biome/pull/12965) [`c33c03d`](https://github.com/biomejs/biome/commit/c33c03dcf80abc1b0775893ca21f179e55af31fe) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useVueRegisteredComponentNameCasing`](https://biomejs.dev/linter/rules/use-vue-registered-component-name-casing/), 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.
  126. ```vue
  127. <script>
  128. export default {
  129. components: {
  130. "todo-item": TodoItem,
  131. },
  132. };
  133. </script>
  134. ```
  135. - [#12145](https://github.com/biomejs/biome/pull/12145) [`596a2b1`](https://github.com/biomejs/biome/commit/596a2b17fbc642fca92ab6b8040314818f49d144) Thanks [@ematipico](https://github.com/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`](https://biomejs.dev/linter/rules/no-unnecessary-conditions/) and [`noFloatingPromises`](https://biomejs.dev/linter/rules/no-floating-promises/). Types such as `{}` no longer imply that a value is always truthy.
  136. - [#12935](https://github.com/biomejs/biome/pull/12935) [`e506ff1`](https://github.com/biomejs/biome/commit/e506ff18271f360b64396d4038e7bddf68feda7c) Thanks [@dyc3](https://github.com/dyc3)! - Improved the performance of the rules [`noRedeclare`](https://biomejs.dev/linter/rules/no-redeclare/) and [`noUnsafeDeclarationMerging`](https://biomejs.dev/linter/rules/no-unsafe-declaration-merging/). `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.
  137. - [#13181](https://github.com/biomejs/biome/pull/13181) [`e1556ae`](https://github.com/biomejs/biome/commit/e1556ae721ee8fb90970bf4f6990d0d5d34aeba6) Thanks [@dyc3](https://github.com/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:
  138. ```diff
  139. - <div><!-- comment -->
  140. + <div>
  141. <!-- comment -->
  142. <i>x</i>
  143. </div>
  144. ```
  145. - [#13130](https://github.com/biomejs/biome/pull/13130) [`1b350ed`](https://github.com/biomejs/biome/commit/1b350ed5027da8778b73efbe99983a627a633acc) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#13107](https://github.com/biomejs/biome/issues/13107): the unsafe fix of [`noDistractingElements`](https://biomejs.dev/linter/rules/no-distracting-elements/) 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>;`.
  146. - [#13054](https://github.com/biomejs/biome/pull/13054) [`4d81f0d`](https://github.com/biomejs/biome/commit/4d81f0d51046b70267a27d137dd87c0ced3737d2) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noUnresolvedImports`](https://biomejs.dev/linter/rules/no-unresolved-imports/) 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.
  147. - [#12602](https://github.com/biomejs/biome/pull/12602) [`d5da394`](https://github.com/biomejs/biome/commit/d5da3946fb3a9a0b610c7cf613b26dc084d494ae) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#12600](https://github.com/biomejs/biome/issues/12600): `biome lint --suppress` now adds suppression comments for diagnostics emitted by plugins, such as ``// biome-ignore lint/plugin/noFoo: ignored using `--suppress` ``.
  148. - [#13097](https://github.com/biomejs/biome/pull/13097) [`3be9e3d`](https://github.com/biomejs/biome/commit/3be9e3d0a45b28d2d59ca71c33d503f462e63f3c) Thanks [@ashokram-si](https://github.com/ashokram-si)! - Fixed [#13064](https://github.com/biomejs/biome/issues/13064): The [`noUnknownTypeSelector`](https://biomejs.dev/linter/rules/no-unknown-type-selector/) rule now correctly accepts the valid `<selectedcontent>` HTML element used in customizable select controls.
  149. - [#13181](https://github.com/biomejs/biome/pull/13181) [`e1556ae`](https://github.com/biomejs/biome/commit/e1556ae721ee8fb90970bf4f6990d0d5d34aeba6) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#13167](https://github.com/biomejs/biome/issues/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:
  150. ```diff
  151. {#if a}
  152. - <i>x</i>
  153. + <!-- comment --><i>x</i>
  154. {/if}
  155. ```
  156. - [#12845](https://github.com/biomejs/biome/pull/12845) [`e3ab04d`](https://github.com/biomejs/biome/commit/e3ab04d52933e1716ad14a04f153d5ad9f33a612) Thanks [@dyc3](https://github.com/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:`.
  157. - [#13098](https://github.com/biomejs/biome/pull/13098) [`d3be626`](https://github.com/biomejs/biome/commit/d3be626ab75ea3a4db7df9e3180864d97f86f8d5) Thanks [@ashokram-si](https://github.com/ashokram-si)! - Fixed [#13084](https://github.com/biomejs/biome/issues/13084): The [`useThisInClassMethods`](https://biomejs.dev/linter/rules/use-this-in-class-methods/) rule now correctly recognizes `this` when used inside parameter default values for methods, setters, and class fields.
  158. - [#13131](https://github.com/biomejs/biome/pull/13131) [`a788cac`](https://github.com/biomejs/biome/commit/a788cac014f5972ae65e634d283b04ea966dbc85) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#13129](https://github.com/biomejs/biome/issues/13129): the fix of [`useArrowFunction`](https://biomejs.dev/linter/rules/use-arrow-function/) 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.
  159. ```js
  160. // Before
  161. for (let has = function (k) { return k in cache; }; ;) {}
  162. // After the fix
  163. for (let has = (k) => (k in cache); ;) {}
  164. ```
  165. - [#12840](https://github.com/biomejs/biome/pull/12840) [`8908627`](https://github.com/biomejs/biome/commit/8908627b26d3263ec332d327297f2b347e4e3e97) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#12796](https://github.com/biomejs/biome/issues/12796): [`useMathMinMax`](https://biomejs.dev/linter/rules/use-math-min-max/) 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`.
  166. ```js
  167. const MAX = 2n ** 62n - 1n;
  168. const clamp = (x) => (x > MAX ? MAX : x);
  169. ```
  170. - [#13152](https://github.com/biomejs/biome/pull/13152) [`61924f6`](https://github.com/biomejs/biome/commit/61924f6e0766c390c681e984cb8eeca0243562c6) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noVueWatchAfterAwait`](https://biomejs.dev/linter/rules/no-vue-watch-after-await/), [`noVueLifecycleAfterAwait`](https://biomejs.dev/linter/rules/no-vue-lifecycle-after-await/) and [`noVueRestrictedCallAfterAwait`](https://biomejs.dev/linter/rules/no-vue-restricted-call-after-await/), which now also check the `setup()` function passed as the first argument of `defineComponent()`. The following code is now reported:
  171. ```js
  172. import { defineComponent, onMounted } from "vue";
  173. defineComponent(async (props) => {
  174. await load();
  175. onMounted(() => {});
  176. }, { props: ["id"] });
  177. ```
  178. When `defineComponent()` receives both a function and an options object, these rules now ignore the `setup` option, because Vue runs the function instead.
  179. - [#13152](https://github.com/biomejs/biome/pull/13152) [`61924f6`](https://github.com/biomejs/biome/commit/61924f6e0766c390c681e984cb8eeca0243562c6) Thanks [@dyc3](https://github.com/dyc3)! - [`noVueDuplicateKeys`](https://biomejs.dev/linter/rules/no-vue-duplicate-keys/) 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`.
  180. - [#13152](https://github.com/biomejs/biome/pull/13152) [`61924f6`](https://github.com/biomejs/biome/commit/61924f6e0766c390c681e984cb8eeca0243562c6) Thanks [@dyc3](https://github.com/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`](https://biomejs.dev/linter/rules/no-vue-undeclared-emits/), [`noVueUnusedEmitDeclarations`](https://biomejs.dev/linter/rules/no-vue-unused-emit-declarations/), [`useVueSingleEventPayload`](https://biomejs.dev/linter/rules/use-vue-single-event-payload/) and [`useVueEmitValidator`](https://biomejs.dev/linter/rules/use-vue-emit-validator/) previously skipped events declared in these forms.
  181. [`noVueShadowNativeEvents`](https://biomejs.dev/linter/rules/no-vue-shadow-native-events/) 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")`.
  182. - [#12947](https://github.com/biomejs/biome/pull/12947) [`a54965d`](https://github.com/biomejs/biome/commit/a54965de793ea8e5abf0a549cd020ec688c00fdf) Thanks [@machadinhos](https://github.com/machadinhos)! - Added the nursery rule [`noDrizzleDbObjectInsideTransaction`](https://biomejs.dev/linter/rules/no-drizzle-db-object-inside-transaction/), which reports a Drizzle ORM instance used inside its own transaction callback instead of the transaction object.
  183. ```js
  184. await db.transaction(async (tx) => {
  185. await db.insert(users).values({ name: "John" });
  186. });
  187. ```
  188. - [#13123](https://github.com/biomejs/biome/pull/13123) [`e7c8297`](https://github.com/biomejs/biome/commit/e7c8297cf2979618655f3dcd6c28d0d0d7d25de6) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#12176](https://github.com/biomejs/biome/issues/12176): type-aware rules now select the matching overload of a method declared several times in an interface or object type. For example, [`useAwaitThenable`](https://biomejs.dev/linter/rules/use-await-thenable/) no longer reports `await app.listen({ port: 0 })` on a Fastify server, and still reports `await app.listen({ port: 0 }, callback)`.
  189. - [#12059](https://github.com/biomejs/biome/pull/12059) [`87784c7`](https://github.com/biomejs/biome/commit/87784c7b9ad9e67da665687cfc22430308f17ffe) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noUnsafePlusOperands`](https://biomejs.dev/linter/rules/no-unsafe-plus-operands/) 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`.
  190. - [#13151](https://github.com/biomejs/biome/pull/13151) [`be372b5`](https://github.com/biomejs/biome/commit/be372b53483f488a47bb36b0cc11760275f2109d) Thanks [@dyc3](https://github.com/dyc3)! - Fixed Vue lint rules such as [`useVueVModel`](https://biomejs.dev/linter/rules/use-vue-v-model/) and [`useVueVOnExact`](https://biomejs.dev/linter/rules/use-vue-v-on-exact/) 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.
  191. - [#12059](https://github.com/biomejs/biome/pull/12059) [`87784c7`](https://github.com/biomejs/biome/commit/87784c7b9ad9e67da665687cfc22430308f17ffe) Thanks [@dyc3](https://github.com/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`](https://biomejs.dev/linter/rules/no-floating-promises/).
  192. ```ts
  193. type Unwrap<T> = T extends Promise<infer U> ? U : T;
  194. // Previously inferred as `unknown | Promise<number>`, now as `number`.
  195. type Value = Unwrap<Promise<number>>;
  196. ```
  197. - [#12602](https://github.com/biomejs/biome/pull/12602) [`d5da394`](https://github.com/biomejs/biome/commit/d5da3946fb3a9a0b610c7cf613b26dc084d494ae) Thanks [@dyc3](https://github.com/dyc3)! - Biome now reports an error when a GritQL plugin file name contains invalid characters that could conflict with Biome suppressions.
  198. - [#12838](https://github.com/biomejs/biome/pull/12838) [`81d8d28`](https://github.com/biomejs/biome/commit/81d8d28b79aa4297829b55bf70754741bb51d31e) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noTailwindRestrictedClasses`](https://biomejs.dev/linter/rules/no-tailwind-restricted-classes/) 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.
  199. ```json
  200. {
  201. "linter": {
  202. "rules": {
  203. "nursery": {
  204. "noTailwindRestrictedClasses": {
  205. "level": "error",
  206. "options": {
  207. "classes": {
  208. "bg-green-500": { "message": "Use the success color.", "use": "bg-success" },
  209. "float-*": "Use flexbox or grid for layout."
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. ```
  218. ```jsx
  219. <div className="hover:bg-green-500 float-left" />; // both classes are reported
  220. ```
  221. - [#12932](https://github.com/biomejs/biome/pull/12932) [`68e6887`](https://github.com/biomejs/biome/commit/68e688703310ec260c61044edd892de6364eba9b) Thanks [@dyc3](https://github.com/dyc3)! - Improved the performance of linting files that have no suppression comments by up to 61%.
  222. - [#13136](https://github.com/biomejs/biome/pull/13136) [`dcb1eab`](https://github.com/biomejs/biome/commit/dcb1eab0dd24a7f1e40f62c8afcd4ca84d28e0d7) Thanks [@dyc3](https://github.com/dyc3)! - Improved the performance of linting JavaScript and HTML files when Tailwind rules are enabled.
  223. - [#13094](https://github.com/biomejs/biome/pull/13094) [`ae66383`](https://github.com/biomejs/biome/commit/ae663830fae75dc0f368446aa553ae7c05e1b830) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#12994](https://github.com/biomejs/biome/issues/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.
  224. ```diff
  225. <span>
  226. Showing the first {shown} of
  227. - {total}
  228. - references
  229. + {total} references
  230. </span>
  231. ```
  232. - [#13162](https://github.com/biomejs/biome/pull/13162) [`854ff15`](https://github.com/biomejs/biome/commit/854ff15ad1cbdaf532d4a68d8044f4b5fdef3a9d) Thanks [@Punisheroot](https://github.com/Punisheroot)! - Fixed [#13125](https://github.com/biomejs/biome/issues/13125): [`noUselessThisAlias`](https://biomejs.dev/linter/rules/no-useless-this-alias/) no longer reports aliases used in instance and static class field initializers, where replacing the alias with `this` changes which object is accessed.
  233. - [#12059](https://github.com/biomejs/biome/pull/12059) [`87784c7`](https://github.com/biomejs/biome/commit/87784c7b9ad9e67da665687cfc22430308f17ffe) Thanks [@dyc3](https://github.com/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`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) and [`noFloatingPromises`](https://biomejs.dev/linter/rules/no-floating-promises/) now see the literal, so the following switch is reported for missing the `"a"` case.
  234. ```ts
  235. type Kind = ("a" & string) | "b";
  236. function handle(kind: Kind) {
  237. switch (kind) {
  238. case "b":
  239. break;
  240. }
  241. }
  242. ```
  243. - [#12551](https://github.com/biomejs/biome/pull/12551) [`ca039a1`](https://github.com/biomejs/biome/commit/ca039a13fb60ee7895a7eb2ef6f47170f4844738) Thanks [@pkallos](https://github.com/pkallos)! - Fixed [#9842](https://github.com/biomejs/biome/issues/9842): [`useNullishCoalescing`](https://biomejs.dev/linter/rules/use-nullish-coalescing/) no longer skips `||` and `||=` inside a call to a locally declared `Boolean` when `ignoreBooleanCoercion` is enabled.
  244. ## What's Changed
  245. * fix(lint/js): count this in parameter defaults in useThisInClassMethods by @ashokram-si in https://github.com/biomejs/biome/pull/13098
  246. * chore(deps): update dependency @types/node to v24.19.2 by @renovate[bot] in https://github.com/biomejs/biome/pull/13046
  247. * fix(lint): check Boolean is global in useNullishCoalescing by @pkallos in https://github.com/biomejs/biome/pull/12551
  248. * chore: delete weird files by @ematipico in https://github.com/biomejs/biome/pull/13117
  249. * feat(type_inference): support conditional types and `infer` bindings by @dyc3 in https://github.com/biomejs/biome/pull/12059
  250. * docs(lint/css): skip Sass-evaluated math functions in useBaseline by @vibbix in https://github.com/biomejs/biome/pull/12974
  251. * feat(types): add flow-sensitive narrowing foundations by @ematipico in https://github.com/biomejs/biome/pull/12145
  252. * feat(types): narrow explicit local predicate calls by @ematipico in https://github.com/biomejs/biome/pull/12146
  253. * feat(types): narrow after standalone assertion calls by @ematipico in https://github.com/biomejs/biome/pull/12147
  254. * feat(lint): add noVueDeprecatedVIs by @dyc3 in https://github.com/biomejs/biome/pull/12545
  255. * feat(lint): add noTailwindRestrictedClasses by @dyc3 in https://github.com/biomejs/biome/pull/12838
  256. * feat(lint): add noTripleSlashReference by @dyc3 in https://github.com/biomejs/biome/pull/12893
  257. * feat(lint): add noMisusedSpread by @dyc3 in https://github.com/biomejs/biome/pull/12904
  258. * feat(lint): add noLateCurrentTargetAccess by @dyc3 in https://github.com/biomejs/biome/pull/12907
  259. * feat(lint): add noDynamicRequire by @dyc3 in https://github.com/biomejs/biome/pull/12924
  260. * feat(lint): add noVueDefineModelDefault by @dyc3 in https://github.com/biomejs/biome/pull/12964
  261. * feat(lint): add noConfusingArraySplice by @dyc3 in https://github.com/biomejs/biome/pull/12966
  262. * feat(lint): add useVueRegisteredComponentNameCasing by @dyc3 in https://github.com/biomejs/biome/pull/12965
  263. * feat(lint): add usePackageJsonValidLicense by @dyc3 in https://github.com/biomejs/biome/pull/13020
  264. * fix(inference): overload in local inference by @ematipico in https://github.com/biomejs/biome/pull/13123
  265. * docs: typo in static value doc comments by @ninglinLiu in https://github.com/biomejs/biome/pull/13132
  266. * chore(deps): update to rust 1.100, add minimum release age config by @dyc3 in https://github.com/biomejs/biome/pull/13124
  267. * fix(noDistractingElements): remove the whole element in the unsafe fix by @dyc3 in https://github.com/biomejs/biome/pull/13130
  268. * fix(useArrowFunction): parenthesize `in` bodies in for initializers by @dyc3 in https://github.com/biomejs/biome/pull/13131
  269. * fix(useMathMinMax): trace bindings a little further to figure out if the arguments are bigints by @dyc3 in https://github.com/biomejs/biome/pull/12840
  270. * perf(inference): queries and namespace by @ematipico in https://github.com/biomejs/biome/pull/13126
  271. * chore: update rule metadata by @dyc3 in https://github.com/biomejs/biome/pull/13134
  272. * perf(package): sublinear SPDX licence lookup by @dyc3 in https://github.com/biomejs/biome/pull/13138
  273. * perf(lint): implement visited_kinds() for tailwind class string query, simplify it by @dyc3 in https://github.com/biomejs/biome/pull/13136
  274. * perf(html): add token set for mathml elements by @dyc3 in https://github.com/biomejs/biome/pull/13151
  275. * refactor(lint): make old vue rules use the new vue semantic model by @dyc3 in https://github.com/biomejs/biome/pull/13152
  276. * feat(lint): add noDrizzleDbObjectInsideTransaction by @machadinhos in https://github.com/biomejs/biome/pull/12947
  277. * fix(format/html): keep words after inline elements on the same line by @dyc3 in https://github.com/biomejs/biome/pull/13094
  278. * fix(lint/css): recognize the selectedcontent element in noUnknownTypeSelector by @ashokram-si in https://github.com/biomejs/biome/pull/13097
  279. * fix(analyze): emit suppression actions for plugin diagnostics by @dyc3 in https://github.com/biomejs/biome/pull/12602
  280. * feat(lint): add useVueConsistentVOnHandlerStyle by @dyc3 in https://github.com/biomejs/biome/pull/13058
  281. * feat(lint): add noVueDeprecatedFilter by @dyc3 in https://github.com/biomejs/biome/pull/13060
  282. * feat(lint): add noYamlEmptyMapValues by @dyc3 in https://github.com/biomejs/biome/pull/13061
  283. * feat(lint): add noYamlEmptyMapKeys by @dyc3 in https://github.com/biomejs/biome/pull/13063
  284. * feat(lint): add noYamlEmptySequenceEntries by @dyc3 in https://github.com/biomejs/biome/pull/13062
  285. * feat(lint): add useExpectToHaveBeenCalled by @dyc3 in https://github.com/biomejs/biome/pull/13075
  286. * feat(lint): add useExpectToHaveBeenCalledTimes by @dyc3 in https://github.com/biomejs/biome/pull/13076
  287. * feat(lint): add useSpyOn by @dyc3 in https://github.com/biomejs/biome/pull/13079
  288. * feat(lint): add noBufferConstructor by @dyc3 in https://github.com/biomejs/biome/pull/13080
  289. * feat(lint): add useTopLevelRequire by @dyc3 in https://github.com/biomejs/biome/pull/13081
  290. * feat(lint): add useCalledWith by @dyc3 in https://github.com/biomejs/biome/pull/13082
  291. * feat(lint): add noVueExportInScriptSetup by @dyc3 in https://github.com/biomejs/biome/pull/12580
  292. * feat(lint): add useValidNamespaceImports by @dyc3 in https://github.com/biomejs/biome/pull/13054
  293. * feat(lint): add noVueAsyncComputed by @dyc3 in https://github.com/biomejs/biome/pull/12561
  294. * fix(tailwind): locate classes in unquoted object keys correctly by @dyc3 in https://github.com/biomejs/biome/pull/12845
  295. * chore(deps): ignore js-sys crate in renovate config by @dyc3 in https://github.com/biomejs/biome/pull/13182
  296. * fix(format/html/svelte): keep comments after block delimiters and opening tags by @dyc3 in https://github.com/biomejs/biome/pull/13181
  297. * fix(lint): preserve this aliases in class field initializers by @Punisheroot in https://github.com/biomejs/biome/pull/13162
  298. * perf(lint): locate binding nodes near the query node in noRedeclare by @dyc3 in https://github.com/biomejs/biome/pull/12935
  299. * perf(analyze): skip the suppression token pass in files without suppression comments by @dyc3 in https://github.com/biomejs/biome/pull/12932
  300. * fix(format/html): print comment before suppressed first child once by @dyc3 in https://github.com/biomejs/biome/pull/13189
  301. * docs(skills): improve comments writing by @ematipico in https://github.com/biomejs/biome/pull/13197
  302. * docs(skill): improve writing style by @ematipico in https://github.com/biomejs/biome/pull/13198
  303. * ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/13104
  304. ## New Contributors
  305. * @machadinhos made their first contribution in https://github.com/biomejs/biome/pull/12947
  306. **Full Changelog**: https://github.com/biomejs/biome/compare/@biomejs/biome@2.6.7...@biomejs/biome@2.6.8

vedi su githubdetected 2026-11-19 via npm