Skip to content
verdict:

Biome 2.6.7

digest

note: no summary for this digest release

Digest releases are listed without a summary. The original release notes for this version are below.

release-notesgithub.com/biomejs/biome · 432 lines
  1. ## 2.6.7
  2. ### Patch Changes
  3. - [#12906](https://github.com/biomejs/biome/pull/12906) [`b3375d2`](https://github.com/biomejs/biome/commit/b3375d2caf4ba351ac887801144bc4258fc66a6e) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noAsyncPromiseFinally`](https://biomejs.dev/linter/rules/no-async-promise-finally/), 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.
  4. ```js
  5. promise.finally(async () => {
  6. await cleanup();
  7. });
  8. ```
  9. - [#12894](https://github.com/biomejs/biome/pull/12894) [`e24da6f`](https://github.com/biomejs/biome/commit/e24da6f6705a0e302bcabdc96ef53c7eebeab814) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noDuplicateTypeConstituents`](https://biomejs.dev/linter/rules/no-duplicate-type-constituents/), which reports types listed more than once in a union or intersection type, and `undefined` in the type of an optional parameter.
  10. ```ts
  11. type T = string | number | string;
  12. function f(a?: string | undefined) {}
  13. ```
  14. - [#12899](https://github.com/biomejs/biome/pull/12899) [`6c15027`](https://github.com/biomejs/biome/commit/6c15027cdb24e768435fa7fbfb12c2c02c12b3f8) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noExcessiveSelectorComplexity`](https://biomejs.dev/linter/rules/no-excessive-selector-complexity/), 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.
  15. For example, with `"maxIds": 1`, the following selector is reported:
  16. ```css
  17. #main #sidebar {}
  18. ```
  19. - [#12897](https://github.com/biomejs/biome/pull/12897) [`0b8f429`](https://github.com/biomejs/biome/commit/0b8f429a38805f0779bdb9b06d95e498acee829b) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noInvalidFetchOptions`](https://biomejs.dev/linter/rules/no-invalid-fetch-options/), 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`.
  20. ```js
  21. await fetch("/", { method: "GET", body: "foo=bar" });
  22. ```
  23. - [#12926](https://github.com/biomejs/biome/pull/12926) [`9b6b9f4`](https://github.com/biomejs/biome/commit/9b6b9f46459977dbd69899de67456cd02736cbaa) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noNewArray`](https://biomejs.dev/linter/rules/no-new-array/), 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.
  24. ```js
  25. const array = new Array(length);
  26. ```
  27. - [#12895](https://github.com/biomejs/biome/pull/12895) [`739440f`](https://github.com/biomejs/biome/commit/739440f66a3bf6781e2276196f4a3135877614d1) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noRedundantTypeConstituents`](https://biomejs.dev/linter/rules/no-redundant-type-constituents/), 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.
  28. ```ts
  29. type Status = "active" | string;
  30. ```
  31. - [#12810](https://github.com/biomejs/biome/pull/12810) [`71ab61b`](https://github.com/biomejs/biome/commit/71ab61bced2604fc17329472e5bff65b7d7a1bcd) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noSvelteAsyncStore`](https://biomejs.dev/linter/rules/no-svelte-async-store/), which disallows passing async functions to the `writable()`, `readable()`, and `derived()` stores from `svelte/store`.
  32. ```js
  33. import { writable } from "svelte/store";
  34. const user = writable(null, async (set) => {
  35. set(await fetchUser());
  36. });
  37. ```
  38. - [#12917](https://github.com/biomejs/biome/pull/12917) [`37d9f41`](https://github.com/biomejs/biome/commit/37d9f4143469221735aa5d0e8a09cd5ea3d42684) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noUnresolvedDefaultImport`](https://biomejs.dev/linter/rules/no-unresolved-default-import/), which reports default imports from modules that have no default export. The rule is part of the `project` domain.
  39. ```js
  40. // foo.js only contains `export function foo() {}`
  41. import foo from "./foo.js";
  42. ```
  43. - [#12892](https://github.com/biomejs/biome/pull/12892) [`f16842e`](https://github.com/biomejs/biome/commit/f16842ed8ad85191da172ca63e9452d7d76efcb6) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noUselessFallbackInSpread`](https://biomejs.dev/linter/rules/no-useless-fallback-in-spread/), 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.
  44. ```js
  45. const object = { ...(options || {}) };
  46. ```
  47. - [#12785](https://github.com/biomejs/biome/pull/12785) [`c198be2`](https://github.com/biomejs/biome/commit/c198be2b71b01dead768987b96506ce674515cc2) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noUselessParameterPropertyAssignment`](https://biomejs.dev/linter/rules/no-useless-parameter-property-assignment/), 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.
  48. ```ts
  49. class User {
  50. constructor(public name: string) {
  51. this.name = name;
  52. }
  53. }
  54. ```
  55. - [#12900](https://github.com/biomejs/biome/pull/12900) [`a4d1b0f`](https://github.com/biomejs/biome/commit/a4d1b0fd45d83c650689460add99f99de6495662) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noUselessSpread`](https://biomejs.dev/linter/rules/no-useless-spread/), 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)`.
  56. - [#12902](https://github.com/biomejs/biome/pull/12902) [`d7d755b`](https://github.com/biomejs/biome/commit/d7d755b0d90cf8a38334d136239129eadbd3a4e7) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noVueExposeAfterAwait`](https://biomejs.dev/linter/rules/no-vue-expose-after-await/), 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.
  57. ```vue
  58. <script setup>
  59. await fetchUser();
  60. defineExpose({ reload });
  61. </script>
  62. ```
  63. - [#12596](https://github.com/biomejs/biome/pull/12596) [`d33e56e`](https://github.com/biomejs/biome/commit/d33e56e958b97360355ac220cc6393dc5916a6c6) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useAtomicUpdates`](https://biomejs.dev/linter/rules/use-atomic-updates/), 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.
  64. ```js
  65. let total = 0;
  66. async function addToTotal(getAmount) {
  67. total += await getAmount(); // reported
  68. }
  69. ```
  70. - [#12901](https://github.com/biomejs/biome/pull/12901) [`48e3572`](https://github.com/biomejs/biome/commit/48e357294beebfbe930c46bf54cc66d3a736e3a3) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useConsistentBooleanName`](https://biomejs.dev/linter/rules/use-consistent-boolean-name/). 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.
  71. ```js
  72. const completed = progress === 100;
  73. const hasName = "Sindre";
  74. ```
  75. - [#12905](https://github.com/biomejs/biome/pull/12905) [`5b00387`](https://github.com/biomejs/biome/commit/5b003879a1d82398ee8a43af19455a1b470252d8) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useConsistentFontWeightNotation`](https://biomejs.dev/linter/rules/use-consistent-font-weight-notation/), 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`.
  76. ```css
  77. a { font-weight: bold; }
  78. ```
  79. - [#12922](https://github.com/biomejs/biome/pull/12922) [`8d33c85`](https://github.com/biomejs/biome/commit/8d33c8541cd3067b122629b3ab5032592d94f537) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useConsistentTupleLabels`](https://biomejs.dev/linter/rules/use-consistent-tuple-labels/), which reports tuple type elements without a label when other elements of the same tuple have one.
  80. ```ts
  81. type Point = [x: number, number];
  82. ```
  83. - [#12925](https://github.com/biomejs/biome/pull/12925) [`7252cbd`](https://github.com/biomejs/biome/commit/7252cbd6e57033df127c6e157d2c77533c8bd532) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useGlobalRegexInMatchAll`](https://biomejs.dev/linter/rules/use-global-regex-in-match-all/), which reports calls to `matchAll()` with a regular expression that doesn't have the `g` flag. These calls throw a `TypeError` at runtime.
  84. ```js
  85. text.matchAll(/pattern/);
  86. ```
  87. - [#12891](https://github.com/biomejs/biome/pull/12891) [`e781bc3`](https://github.com/biomejs/biome/commit/e781bc3037396ed000d2ec56bfc9e92e5b10fefd) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useGlobalRegexInReplaceAll`](https://biomejs.dev/linter/rules/use-global-regex-in-replace-all/), which reports regular expressions without the `g` flag passed to `replaceAll()`. These calls throw a `TypeError` instead of replacing text.
  88. ```js
  89. withSpaces.replaceAll(/\s+/, ",");
  90. ```
  91. - [#12896](https://github.com/biomejs/biome/pull/12896) [`a968e1a`](https://github.com/biomejs/biome/commit/a968e1a0e2fa99837f6fa731e326960bf594beed) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useValidCharacterComparison`](https://biomejs.dev/linter/rules/use-valid-character-comparison/), 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 `!=`.
  92. ```js
  93. text.charAt(0) === "ab";
  94. ```
  95. - [#13085](https://github.com/biomejs/biome/pull/13085) [`7a795d0`](https://github.com/biomejs/biome/commit/7a795d07e188adaf726ce818a07b7ef979eee4ac) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [withastro/compiler-rs#221](https://github.com/withastro/compiler-rs/issues/221) so Astro template expressions containing comment-only JSX expression children, such as `<span>{<!-- x -->}</span>`, parse without diagnostics.
  96. - [#12621](https://github.com/biomejs/biome/pull/12621) [`79ce388`](https://github.com/biomejs/biome/commit/79ce388835afd7a402a2378a426ff495686177c4) Thanks [@latin-1](https://github.com/latin-1)! - Fixed [#12413](https://github.com/biomejs/biome/issues/12413) and [#12414](https://github.com/biomejs/biome/issues/12414): [`useSortedProperties`](https://biomejs.dev/assist/actions/use-sorted-properties/) now sorts consecutive groups of properties independently, preserving the positions of nested rules, at-rules, and SCSS variable declarations.
  97. - [#13065](https://github.com/biomejs/biome/pull/13065) [`bd9faae`](https://github.com/biomejs/biome/commit/bd9faae50e48d17a8ac908029e6729f39b665e61) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#5848](https://github.com/biomejs/biome/issues/5848): running [`useSortedKeys`](https://biomejs.dev/assist/actions/use-sorted-keys/) or [`useSortedSelectionSet`](https://biomejs.dev/assist/actions/use-sorted-selection-set/) as an editor source action no longer corrupts nested objects or selection sets.
  98. - [#13056](https://github.com/biomejs/biome/pull/13056) [`98f4d53`](https://github.com/biomejs/biome/commit/98f4d533a1e68b8f170cfdc1a7a128df77845510) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#10607](https://github.com/biomejs/biome/issues/10607): [`noUndeclaredDependencies`](https://biomejs.dev/linter/rules/no-undeclared-dependencies/) no longer reports imports resolved through TypeScript's `compilerOptions.paths` mappings.
  99. - [#13033](https://github.com/biomejs/biome/pull/13033) [`7638393`](https://github.com/biomejs/biome/commit/76383936f3a4e4224ad3e87956642f752c01097a) Thanks [@GBra-4-669](https://github.com/GBra-4-669)! - Fixed [#12980](https://github.com/biomejs/biome/issues/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.
  100. - [#12917](https://github.com/biomejs/biome/pull/12917) [`37d9f41`](https://github.com/biomejs/biome/commit/37d9f4143469221735aa5d0e8a09cd5ea3d42684) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noUnresolvedImports`](https://biomejs.dev/linter/rules/no-unresolved-imports/): 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"`.
  101. - [#12596](https://github.com/biomejs/biome/pull/12596) [`d33e56e`](https://github.com/biomejs/biome/commit/d33e56e958b97360355ac220cc6393dc5916a6c6) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noUnreachableSuper`](https://biomejs.dev/linter/rules/no-unreachable-super/) 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.
  102. ```js
  103. class Child extends Parent {
  104. constructor(options = this.defaults()) { // reported
  105. super(options);
  106. }
  107. }
  108. ```
  109. - [#12596](https://github.com/biomejs/biome/pull/12596) [`d33e56e`](https://github.com/biomejs/biome/commit/d33e56e958b97360355ac220cc6393dc5916a6c6) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [`noUselessAssignment`](https://biomejs.dev/linter/rules/no-useless-assignment/) ignoring variables that are used in the iterated value of a `for...of` or `for...in` loop, in the default values of a destructuring declaration or of parameters, or in the body of an arrow function written as a single expression. These variables are now checked too.
  110. ```js
  111. function process(first, second) {
  112. let list = first; // reported: this value is never read
  113. list = second;
  114. for (const item of list) {
  115. handle(item);
  116. }
  117. }
  118. ```
  119. - [#12805](https://github.com/biomejs/biome/pull/12805) [`2468384`](https://github.com/biomejs/biome/commit/2468384ab3cd0cab5457bc09050e00b7b099b0d2) Thanks [@vibbix](https://github.com/vibbix)! - Fixed [#12332](https://github.com/biomejs/biome/issues/12332): [`noUnknownUnit`](https://biomejs.dev/linter/rules/no-unknown-unit/) no longer reports hex colors that start with a digit in SCSS custom properties or in unquoted legacy IE `filter` values. The rule now accepts `--accent: #4566a8;` instead of reporting the unknown unit `a8`.
  120. - [#12549](https://github.com/biomejs/biome/pull/12549) [`7fdb28f`](https://github.com/biomejs/biome/commit/7fdb28f7a636f8737e3b3e3a974d584f20959018) Thanks [@pkallos](https://github.com/pkallos)! - Fixed [#10464](https://github.com/biomejs/biome/issues/10464): [`useNullishCoalescing`](https://biomejs.dev/linter/rules/use-nullish-coalescing/) no longer reports a ternary or `if` statement that checks only `null` or only `undefined` when the type can also be the other, because `??` would change its behavior.
  121. - [#12952](https://github.com/biomejs/biome/pull/12952) [`d1896a0`](https://github.com/biomejs/biome/commit/d1896a07302b835acf2894083f7829736bee7537) Thanks [@arendjr](https://github.com/arendjr)! - Added `grit()` queries to JavaScript plugins. A rule can now use a GritQL pattern to select the nodes passed to `run()` instead of listing syntax kinds with `ast()`.
  122. For example:
  123. ```ts
  124. export const noConsole = defineRule({
  125. query: grit("`console.log($args)`"),
  126. run(element) {
  127. if (element.kind !== "JS_CALL_EXPRESSION") return;
  128. registerDiagnostic(element, "warning", "Unexpected console.log.");
  129. },
  130. });
  131. ```
  132. Usage of Grit patterns can be particularly useful when it would take several checks to verify the shape of a snippet that involves multiple AST nodes.
  133. Grit sequence patterns call `run()` for each matched node. Matching on leaf tokens is also supported for patterns, while patterns containing rewrites are rejected. Plugins using GritQL patterns should report diagnostics from `run()` as usual.
  134. Plugins using Grit queries can still request the semantic model as well:
  135. ```ts
  136. export const rule = defineRule({
  137. query: grit("function $fn($args) { $body }", { semantic: true }),
  138. run(node, { model }) {
  139. // You can use `model` here similar to a query specified using `ast(..., { semantic: true })`.
  140. },
  141. });
  142. ```
  143. - [#13022](https://github.com/biomejs/biome/pull/13022) [`81d0187`](https://github.com/biomejs/biome/commit/81d0187ed947e3647e4ad422112d012f7f1283d9) Thanks [@arendjr](https://github.com/arendjr)! - Fixed an issue where GritQL patterns wouldn't match snippets if they contain a trailing list separator.
  144. For example, the pattern `` `a, b` `` wouldn't match the arguments in `function(a, b,)`, whereas now they do.
  145. - [#12999](https://github.com/biomejs/biome/pull/12999) [`ace98cf`](https://github.com/biomejs/biome/commit/ace98cff2ed85b13b537143ec89adc22843a75e4) Thanks [@deepsingh132](https://github.com/deepsingh132)! - Fixed [#12953](https://github.com/biomejs/biome/issues/12953): the Markdown formatter no longer removes the blank line between a blockquote that ends a list item and the block that follows it, matching Prettier. Removing that line could also move a following paragraph into the blockquote. The same applies to a list item that ends with a hard line break.
  146. ```diff
  147. - a
  148. > b
  149. +
  150. #### Heading
  151. ```
  152. - [#13067](https://github.com/biomejs/biome/pull/13067) [`45c8c4d`](https://github.com/biomejs/biome/commit/45c8c4d9f1420a1ea6eda028ce1a3aaf8224fd78) Thanks [@ematipico](https://github.com/ematipico)! - Added the nursery rule [`noDisabledAttribute`](https://biomejs.dev/linter/rules/no-disabled-attribute/), which warns when buttons and other form controls use the native `disabled` attribute. A disabled control can't be reached with the Tab key, so the rule suggests `aria-disabled` or `readonly` instead.
  153. ```jsx
  154. <button disabled>Save</button>
  155. <input type="email" disabled />
  156. ```
  157. - [#12923](https://github.com/biomejs/biome/pull/12923) [`0668c8f`](https://github.com/biomejs/biome/commit/0668c8ff61f7f2ef066c6ae5019ec5a79a7f24d5) Thanks [@dyc3](https://github.com/dyc3)! - Added the new nursery rule [`noScssNullComparison`](https://biomejs.dev/linter/rules/no-scss-null-comparison/). It reports comparisons to `null` in Sass `@if` and `@else if` conditions, because `null` already counts as false in a condition.
  158. ```scss
  159. a {
  160. @if $value == null {}
  161. }
  162. ```
  163. - [#12955](https://github.com/biomejs/biome/pull/12955) [`e1ef913`](https://github.com/biomejs/biome/commit/e1ef91390ce3c02bc15ebf58482b082a6ab97a46) Thanks [@ematipico](https://github.com/ematipico)! - Fixed an issue where Biome could silently skip configured plugins. Biome now reports an error when those plugins are unavailable during analysis.
  164. - [#12997](https://github.com/biomejs/biome/pull/12997) [`419aa5d`](https://github.com/biomejs/biome/commit/419aa5dd1ddc8ae3d698f7901a068104d048ec2d) Thanks [@Riccardo-bit-cpu](https://github.com/Riccardo-bit-cpu)! - Fixed [#12475](https://github.com/biomejs/biome/issues/12475): [`noSwitchDeclarations`](https://biomejs.dev/linter/rules/no-switch-declarations/) no longer reports `var` declarations inside `switch` clauses, matching ESLint's `no-case-declarations`.
  165. - [#12867](https://github.com/biomejs/biome/pull/12867) [`6a25d72`](https://github.com/biomejs/biome/commit/6a25d72694a0cfb8f38667d148cbedaefac56559) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`noUselessQualifier`](https://biomejs.dev/linter/rules/no-useless-qualifier/), which reports namespace and enum names that are repeated before a member inside that same namespace or enum. Biome provides a fix that removes the repeated name.
  166. ```ts
  167. namespace Shapes {
  168. export type Point = { x: number; y: number };
  169. const origin: Shapes.Point = { x: 0, y: 0 };
  170. }
  171. ```
  172. - [#12050](https://github.com/biomejs/biome/pull/12050) [`60f4695`](https://github.com/biomejs/biome/commit/60f46952be732210d52fc4a45c01fbbf88acdb3c) Thanks [@dor-sr](https://github.com/dor-sr)! - Fixed [#11933](https://github.com/biomejs/biome/issues/11933): [`useUnicodeRegex`](https://biomejs.dev/linter/rules/use-unicode-regex/) no longer offers to add the `u` flag to patterns that become invalid or change meaning in Unicode mode, such as `/{/`, `/\-/` or `/[\d-z]/`. The rule still reports them.
  173. - [#13035](https://github.com/biomejs/biome/pull/13035) [`478e056`](https://github.com/biomejs/biome/commit/478e0561852b269b0fe2d13ce80baa9a26c88478) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#13026](https://github.com/biomejs/biome/issues/13026): the Markdown formatter no longer indents the rows of a table inside a blockquote when the table follows a paragraph of two or more lines. Previously, every run of the formatter indented the rows further until they were joined onto the header line.
  174. ```diff
  175. > First line of a paragraph,
  176. > second line of it.
  177. >
  178. > | A | B |
  179. - > | --- | --- |
  180. - > | x | y |
  181. + > | --- | --- |
  182. + > | x | y |
  183. ```
  184. - [#13066](https://github.com/biomejs/biome/pull/13066) [`f6cf28e`](https://github.com/biomejs/biome/commit/f6cf28e3518f6030861f1e4063c30a6091b57197) Thanks [@arendjr](https://github.com/arendjr)! - Removed the `semantic()` query function from the JavaScript plugin API. Pass `{ semantic: true }` to `ast()` instead to provide the semantic model to a rule.
  185. ```ts
  186. export const rule = defineRule({
  187. query: semantic("JS_REFERENCE_IDENTIFIER"),
  188. run(node, { model }) {
  189. // Use `model` here.
  190. },
  191. });
  192. ```
  193. Becomes:
  194. ```ts
  195. export const rule = defineRule({
  196. query: ast("JS_REFERENCE_IDENTIFIER", { semantic: true }),
  197. run(node, { model }) {
  198. // Use `model` here.
  199. },
  200. });
  201. ```
  202. This behaviour matches the `grit()` query function, which also accepts the `{ semantic: true }` option.
  203. - [#12951](https://github.com/biomejs/biome/pull/12951) [`014b976`](https://github.com/biomejs/biome/commit/014b976ba021119c5c99cfe6bb07361c8e89edc9) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#10782](https://github.com/biomejs/biome/issues/10782): [`noUndeclaredClasses`](https://biomejs.dev/linter/rules/no-undeclared-classes/) no longer appears to hang on projects with long component import chains.
  204. - [#13073](https://github.com/biomejs/biome/pull/13073) [`827e610`](https://github.com/biomejs/biome/commit/827e6103c9baf8c4d42ff50692ea98f32d4a2d2c) Thanks [@vibbix](https://github.com/vibbix)! - Fixed [#13072](https://github.com/biomejs/biome/issues/13072): a comment before a SCSS map entry whose value is a parenthesized group no longer indents that group one level too deep. This matches Prettier 3.10 behavior now.
  205. ```diff
  206. $map: (
  207. /* comment */
  208. key: (
  209. - a: 1,
  210. - b: 2,
  211. - ),
  212. + a: 1,
  213. + b: 2,
  214. + ),
  215. );
  216. ```
  217. - [#12928](https://github.com/biomejs/biome/pull/12928) [`ae0e186`](https://github.com/biomejs/biome/commit/ae0e186b7ba1a245595d5685c525b6ce60cf5a62) Thanks [@dyc3](https://github.com/dyc3)! - Improved [`noUselessStringConcat`](https://biomejs.dev/linter/rules/no-useless-string-concat/). The rule now reports literals joined after another value, such as `foo + "a" + "b"`, and fixes template literals with placeholders, so `` `Hello, ${name}` + "!" `` becomes `` `Hello, ${name}!` ``.
  218. The rule no longer reports strings that would join into text that looks like a placeholder, such as `"$" + "{name}"`, or into a directive such as `"use strict"`. It also no longer reports `obj.foo * "a" + "b"`, which its fix used to change to `obj.foo * "ab"`.
  219. The fix no longer changes the value of the string in two cases. It used to change `1 + 2 + "b" + "c"` to `"12bc"` instead of `1 + 2 + "bc"`. It used to change `"\1" + "2"` to `"\12"`, which is a different escape sequence.
  220. The fix no longer joins literals that are on different lines when the concatenation ends with two literals on the same line. It also no longer puts a line break from a template literal into a string literal, which made the code invalid.
  221. - [#13048](https://github.com/biomejs/biome/pull/13048) [`24734a8`](https://github.com/biomejs/biome/commit/24734a8a91befa250d3466d555af5c8b77c4c070) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#13028](https://github.com/biomejs/biome/issues/13028): Biome now keeps a paragraph in its outer block quote when a quote-only blank line closes a nested block quote.
  222. ```diff
  223. > > b
  224. >
  225. -> > c
  226. +> c
  227. ```
  228. - [#12967](https://github.com/biomejs/biome/pull/12967) [`bd0988e`](https://github.com/biomejs/biome/commit/bd0988e566acadb7375026c3f24b27b0d491eb15) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#12827](https://github.com/biomejs/biome/issues/12827): [`noDuplicateProperties`](https://biomejs.dev/linter/rules/no-duplicate-properties/), [`noDuplicateCustomProperties`](https://biomejs.dev/linter/rules/no-duplicate-custom-properties/), and [`noMissingVarFunction`](https://biomejs.dev/linter/rules/no-missing-var-function/) now check declarations at the top level of embedded CSS templates, such as `` styled.div`...` ``.
  229. - [#13048](https://github.com/biomejs/biome/pull/13048) [`24734a8`](https://github.com/biomejs/biome/commit/24734a8a91befa250d3466d555af5c8b77c4c070) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#13029](https://github.com/biomejs/biome/issues/13029): the Markdown formatter now normalizes spaces inside inline and reference link text without removing whitespace-only text.
  230. ```diff
  231. -something [ text ]( destination)
  232. -something [ ]( destination)
  233. +something [ text ](destination)
  234. +something [ ](destination)
  235. ```
  236. - [#13021](https://github.com/biomejs/biome/pull/13021) [`05a1409`](https://github.com/biomejs/biome/commit/05a14096d37cc6a83211125ce51241c98c1b681d) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#12993](https://github.com/biomejs/biome/issues/12993): Svelte `{@const}` tags with TypeScript type annotations, such as `{@const doubled: number = item * 2}`, now parse and format in components with `<script lang="ts">`.
  237. - [#12968](https://github.com/biomejs/biome/pull/12968) [`ec0142b`](https://github.com/biomejs/biome/commit/ec0142bfd45d7260f5241ad291a7c02bd0bfe24e) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#12826](https://github.com/biomejs/biome/issues/12826): Biome now detects CSS in styled-components templates that use `.attrs()`, such as `` styled.button.attrs({ type: "button" })`...` `` and `` styled(Component).attrs(() => ({}))`...` ``, so they are formatted and linted like `` styled.button`...` ``.
  238. - [#13048](https://github.com/biomejs/biome/pull/13048) [`24734a8`](https://github.com/biomejs/biome/commit/24734a8a91befa250d3466d555af5c8b77c4c070) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#13027](https://github.com/biomejs/biome/issues/13027): the Markdown formatter now preserves spaces around text after a code span that crosses block quote lines.
  239. ```diff
  240. > `a
  241. -> b`c`d`
  242. +> b` c `d`
  243. ```
  244. - [#13055](https://github.com/biomejs/biome/pull/13055) [`78c744a`](https://github.com/biomejs/biome/commit/78c744ad9b730c1429eac6979c2a7c9c04170d83) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#13053](https://github.com/biomejs/biome/issues/13053): Biome now reports missing CLI paths as file-system errors without the `INTERNAL` tag or advice that the path was ignored by configuration. File-system diagnostics now use specific `fs/*` categories, with underlying I/O errors categorized as `fs/io`.
  245. - [#12927](https://github.com/biomejs/biome/pull/12927) [`c6feec1`](https://github.com/biomejs/biome/commit/c6feec1a09da6d3176e0443ed63a4510500be2d0) Thanks [@dyc3](https://github.com/dyc3)! - Added the nursery rule [`useCatchErrorName`](https://biomejs.dev/linter/rules/use-catch-error-name/), which requires a specific name for caught errors in `try...catch` statements and in the error handlers of `promise.catch()` and `promise.then()`. The name defaults to `error` and can be changed with the `name` option.
  246. ```js
  247. try {} catch (err) {} // `err` should be named `error`
  248. ```
  249. - [#12788](https://github.com/biomejs/biome/pull/12788) [`7f971ed`](https://github.com/biomejs/biome/commit/7f971eddf9af7e1bb6e05dce9cd0ba80d04da509) Thanks [@dyc3](https://github.com/dyc3)! - Extended [`useWhile`](https://biomejs.dev/linter/rules/use-while/) to report `for (;;)` loops and to fix them to `while (true)`.
  250. - [#12967](https://github.com/biomejs/biome/pull/12967) [`bd0988e`](https://github.com/biomejs/biome/commit/bd0988e566acadb7375026c3f24b27b0d491eb15) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [`noMissingVarFunction`](https://biomejs.dev/linter/rules/no-missing-var-function/) so it also checks declarations inside at-rules such as `@page` and `@font-face`. For example, `@page { margin: --page-margin; }` is now reported when `--page-margin` is declared in `:root`.
  251. - [#13057](https://github.com/biomejs/biome/pull/13057) [`d9267a5`](https://github.com/biomejs/biome/commit/d9267a5e5f46b8f768902e48007d76c0819771cf) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#10896](https://github.com/biomejs/biome/issues/10896) so Svelte `<script generics>` attributes containing object type constraints parse and format as TypeScript type parameters.
  252. - [#13048](https://github.com/biomejs/biome/pull/13048) [`24734a8`](https://github.com/biomejs/biome/commit/24734a8a91befa250d3466d555af5c8b77c4c070) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#13038](https://github.com/biomejs/biome/issues/13038): Biome now aligns wrapped task-list paragraphs with the text following the checkbox.
  253. ```diff
  254. - [ ] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc varius
  255. - malesuada eros, faucibus dapibus odio rhoncus in.
  256. + malesuada eros, faucibus dapibus odio rhoncus in.
  257. ```
  258. ## What's Changed
  259. * chore: remove graphite from sponsors by @dyc3 in https://github.com/biomejs/biome/pull/12988
  260. * fix(graph): memoize upward traversal by @ematipico in https://github.com/biomejs/biome/pull/12951
  261. * fix(plugins): emit error on missing plugin by @ematipico in https://github.com/biomejs/biome/pull/12955
  262. * fix(lint/useUnicodeRegex): don't add the u flag to patterns invalid in unicode mode by @dor-sr in https://github.com/biomejs/biome/pull/12050
  263. * fix(lint/css): resolve root declarations in embedded snippets by @siketyan in https://github.com/biomejs/biome/pull/12967
  264. * feat(embeds/css): parse `styled.a.attrs()` as embedded CSS snippets by @siketyan in https://github.com/biomejs/biome/pull/12968
  265. * feat: support GritQL queries in JS plugins by @arendjr in https://github.com/biomejs/biome/pull/12952
  266. * fix(lint): don't report `var` in `noSwitchDeclarations` by @Riccardo-bit-cpu in https://github.com/biomejs/biome/pull/12997
  267. * fix(svelte): parse type annotations in const tags by @dyc3 in https://github.com/biomejs/biome/pull/13021
  268. * fix(grit): allow matching trailing list separator by @arendjr in https://github.com/biomejs/biome/pull/13022
  269. * feat(lint): add NoReactDirectStateMutation by @jelly in https://github.com/biomejs/biome/pull/13034
  270. * fix(useWhile): detect and fix infinite for loops by @dyc3 in https://github.com/biomejs/biome/pull/12788
  271. * docs: remove duplicated word in HTML formatter debug comment by @ninglinLiu in https://github.com/biomejs/biome/pull/13039
  272. * feat(lint): add noSvelteAsyncStore by @dyc3 in https://github.com/biomejs/biome/pull/12810
  273. * feat(lint): add noUselessParameterPropertyAssignment by @dyc3 in https://github.com/biomejs/biome/pull/12785
  274. * feat(lint): add noUselessQualifier by @dyc3 in https://github.com/biomejs/biome/pull/12867
  275. * feat(lint): add useGlobalRegexInReplaceAll by @dyc3 in https://github.com/biomejs/biome/pull/12891
  276. * feat(lint): add noUselessFallbackInSpread by @dyc3 in https://github.com/biomejs/biome/pull/12892
  277. * feat(lint): add useValidCharacterComparison by @dyc3 in https://github.com/biomejs/biome/pull/12896
  278. * feat(lint): add noExcessiveSelectorComplexity by @dyc3 in https://github.com/biomejs/biome/pull/12899
  279. * feat(lint): add useGlobalRegexInMatchAll by @dyc3 in https://github.com/biomejs/biome/pull/12925
  280. * feat(lint): add noScssNullComparison by @dyc3 in https://github.com/biomejs/biome/pull/12923
  281. * feat(lint): add noUnresolvedDefaultImport by @dyc3 in https://github.com/biomejs/biome/pull/12917
  282. * feat(lint): add useConsistentTupleLabels by @dyc3 in https://github.com/biomejs/biome/pull/12922
  283. * feat(lint): add useConsistentFontWeightNotation by @dyc3 in https://github.com/biomejs/biome/pull/12905
  284. * feat(lint): add noAsyncPromiseFinally by @dyc3 in https://github.com/biomejs/biome/pull/12906
  285. * feat(lint): add noUselessSpread by @dyc3 in https://github.com/biomejs/biome/pull/12900
  286. * feat(lint): add useConsistentBooleanName by @dyc3 in https://github.com/biomejs/biome/pull/12901
  287. * feat(lint): add noInvalidFetchOptions by @dyc3 in https://github.com/biomejs/biome/pull/12897
  288. * feat(lint): add noVueExposeAfterAwait by @dyc3 in https://github.com/biomejs/biome/pull/12902
  289. * feat(lint): add noNewArray by @dyc3 in https://github.com/biomejs/biome/pull/12926
  290. * feat(lint): add useCatchErrorName by @dyc3 in https://github.com/biomejs/biome/pull/12927
  291. * feat(lint): add noRedundantTypeConstituents by @dyc3 in https://github.com/biomejs/biome/pull/12895
  292. * feat(lint): add noDuplicateTypeConstituents by @dyc3 in https://github.com/biomejs/biome/pull/12894
  293. * feat(lint): expand noUselessStringConcat by @dyc3 in https://github.com/biomejs/biome/pull/12928
  294. * feat(lint): add useAtomicUpdates and some fixes in the control flow graph by @dyc3 in https://github.com/biomejs/biome/pull/12596
  295. * fix(css): sort consecutive property groups independently by @latin-1 in https://github.com/biomejs/biome/pull/12621
  296. * chore(deps): update rust crate jiff to 0.2.41 by @renovate[bot] in https://github.com/biomejs/biome/pull/13040
  297. * chore(deps): update rust crate smallvec to 1.16.5 by @renovate[bot] in https://github.com/biomejs/biome/pull/13043
  298. * chore(deps): update rust crate notify to 8.2.2 by @renovate[bot] in https://github.com/biomejs/biome/pull/13042
  299. * fix(markdown_formatter): keep blank line after a blockquote ending a list item by @deepsingh132 in https://github.com/biomejs/biome/pull/12999
  300. * fix(css_parser): don't panic on non-identifier composes value by @GBra-4-669 in https://github.com/biomejs/biome/pull/13033
  301. * feat(rowan): port upstream navigation APIs by @ematipico in https://github.com/biomejs/biome/pull/13050
  302. * refactor: adopt Rowan navigation APIs by @ematipico in https://github.com/biomejs/biome/pull/13051
  303. * refactor(vue): allow easier lookup of syntax nodes from vue semantic model objects by @dyc3 in https://github.com/biomejs/biome/pull/12916
  304. * chore(deps): update rust to v1.99.1 by @renovate[bot] in https://github.com/biomejs/biome/pull/13047
  305. * fix(md/fmt): various bugs by @ematipico in https://github.com/biomejs/biome/pull/13048
  306. * fix(format/md): keep table rows in blockquotes aligned by @dyc3 in https://github.com/biomejs/biome/pull/13035
  307. * fix(cli): os error by @ematipico in https://github.com/biomejs/biome/pull/13055
  308. * fix(core): parse and visit generics by @ematipico in https://github.com/biomejs/biome/pull/13057
  309. * fix(analyzer): skip subtree for sort rules by @ematipico in https://github.com/biomejs/biome/pull/13065
  310. * feat(lint): `noDisabledButton` rule by @ematipico in https://github.com/biomejs/biome/pull/13067
  311. * fix(lint/css): add fixed SCSS map comment indentation by @vibbix in https://github.com/biomejs/biome/pull/13073
  312. * chore: remove semantic() query function from JS plugin API by @arendjr in https://github.com/biomejs/biome/pull/13066
  313. * fix(lint): don't report partial nullish checks in useNullishCoalescing by @pkallos in https://github.com/biomejs/biome/pull/12549
  314. * fix(parse/astro): html comments in expressions by @ematipico in https://github.com/biomejs/biome/pull/13085
  315. * chore(deps): fix advisories by @dyc3 in https://github.com/biomejs/biome/pull/13090
  316. * fix(css_parser): lex digit-led hash names in raw custom property values by @vibbix in https://github.com/biomejs/biome/pull/12805
  317. * fix(noUndeclaredDependencies): typescript paths by @ematipico in https://github.com/biomejs/biome/pull/13056
  318. * feat(lint): cover all form controls in noDisabledAttribute by @dyc3 in https://github.com/biomejs/biome/pull/13096
  319. * ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/12989
  320. ## New Contributors
  321. * @dor-sr made their first contribution in https://github.com/biomejs/biome/pull/12050
  322. * @Riccardo-bit-cpu made their first contribution in https://github.com/biomejs/biome/pull/12997
  323. * @ninglinLiu made their first contribution in https://github.com/biomejs/biome/pull/13039
  324. * @deepsingh132 made their first contribution in https://github.com/biomejs/biome/pull/12999
  325. * @GBra-4-669 made their first contribution in https://github.com/biomejs/biome/pull/13033
  326. **Full Changelog**: https://github.com/biomejs/biome/compare/@biomejs/biome@2.6.6...@biomejs/biome@2.6.7

view on githubdetected 2026-11-19 via npm