Skip to content
verdict:

Biome 2.2.5

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 · 445 lines
  1. ## 2.2.5
  2. ### Patch Changes
  3. - [#7597](https://github.com/biomejs/biome/pull/7597) [`5c3d542`](https://github.com/biomejs/biome/commit/5c3d542e65fee652dc4e52f3ec2de0441c3f3aec) Thanks [@arendjr](https://github.com/arendjr)! - Fixed [#6432](https://github.com/biomejs/biome/issues/6432): [`useImportExtensions`](https://biomejs.dev/linter/rules/use-import-extensions/) now works correctly with aliased paths.
  4. - [#7269](https://github.com/biomejs/biome/pull/7269) [`f18dac1`](https://github.com/biomejs/biome/commit/f18dac1d662c426d036894a59755eb26f5668aaf) Thanks [@CDGardner](https://github.com/CDGardner)! - Fixed [#6648](https://github.com/biomejs/biome/issues/6648), where Biome's `noUselessFragments` contained inconsistencies with ESLint for fragments only containing text.
  5. Previously, Biome would report that fragments with only text were unnecessary under the `noUselessFragments` rule. Further analysis of ESLint's behavior towards these cases revealed that text-only fragments (`<>A</a>`, `<React.Fragment>B</React.Fragment>`, `<RenamedFragment>B</RenamedFragment>`) would not have `noUselessFragments` emitted for them.
  6. On the Biome side, instances such as these would emit `noUselessFragments`, and applying the suggested fix would turn the text content into a proper JS string.
  7. ```js
  8. // Ended up as: - const t = "Text"
  9. const t = <>Text</>
  10. // Ended up as: - const e = t ? "Option A" : "Option B"
  11. const e = t ? <>Option A</> : <>Option B</>
  12. /* Ended up as:
  13. function someFunc() {
  14. return "Content desired to be a multi-line block of text."
  15. }
  16. */
  17. function someFunc() {
  18. return <>
  19. Content desired to be a multi-line
  20. block of text.
  21. <>
  22. }
  23. ```
  24. The proposed update was to align Biome's reaction to this rule with ESLint's; the aforementioned examples will now be supported from Biome's perspective, thus valid use of fragments.
  25. ```js
  26. // These instances are now valid and won't be called out by noUselessFragments.
  27. const t = <>Text</>
  28. const e = t ? <>Option A</> : <>Option B</>
  29. function someFunc() {
  30. return <>
  31. Content desired to be a multi-line
  32. block of text.
  33. <>
  34. }
  35. ```
  36. - [#7498](https://github.com/biomejs/biome/pull/7498) [`002cded`](https://github.com/biomejs/biome/commit/002cded543e6aa5f5cf55f48312f40c83975a22f) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#6893](https://github.com/biomejs/biome/issues/6893): The [`useExhaustiveDependencies`](https://biomejs.dev/linter/rules/use-exhaustive-dependencies/) rule now correctly adds a dependency that is captured in a shorthand object member. For example:
  37. ```jsx
  38. useEffect(() => {
  39. console.log({ firstId, secondId });
  40. }, []);
  41. ```
  42. is now correctly fixed to:
  43. ```jsx
  44. useEffect(() => {
  45. console.log({ firstId, secondId });
  46. }, [firstId, secondId]);
  47. ```
  48. - [#7509](https://github.com/biomejs/biome/pull/7509) [`1b61631`](https://github.com/biomejs/biome/commit/1b61631c63f161fa8163365571825c99aed3eaae) Thanks [@siketyan](https://github.com/siketyan)! - Added a new lint rule [`noReactForwardRef`](https://biomejs.dev/linter/rules/no-react-forward-ref/), which detects usages of `forwardRef` that is no longer needed and deprecated in React 19.
  49. For example:
  50. ```jsx
  51. export const Component = forwardRef(function Component(props, ref) {
  52. return <div ref={ref} />;
  53. });
  54. ```
  55. will be fixed to:
  56. ```jsx
  57. export const Component = function Component({ ref, ...props }) {
  58. return <div ref={ref} />;
  59. };
  60. ```
  61. Note that the rule provides an unsafe fix, which may break the code. Don't forget to review the code after applying the fix.
  62. - [#7520](https://github.com/biomejs/biome/pull/7520) [`3f06e19`](https://github.com/biomejs/biome/commit/3f06e19c6eb8476ad9de4e3dac00c50a2d6f0aed) Thanks [@arendjr](https://github.com/arendjr)! - Added new nursery rule [`noDeprecatedImports`](https://biomejs.dev/linter/rules/no-deprecated-imports/) to flag imports of deprecated symbols.
  63. #### Invalid example
  64. ```js
  65. // foo.js
  66. import { oldUtility } from "./utils.js";
  67. ```
  68. ```js
  69. // utils.js
  70. /**
  71. * @deprecated
  72. */
  73. export function oldUtility() {}
  74. ```
  75. #### Valid examples
  76. ```js
  77. // foo.js
  78. import { newUtility, oldUtility } from "./utils.js";
  79. ```
  80. ```js
  81. // utils.js
  82. export function newUtility() {}
  83. // @deprecated (this is not a JSDoc comment)
  84. export function oldUtility() {}
  85. ```
  86. - [#7457](https://github.com/biomejs/biome/pull/7457) [`9637f93`](https://github.com/biomejs/biome/commit/9637f9308fe39f7e94d42419cd430cc2a55d5473) Thanks [@kedevked](https://github.com/kedevked)! - Added `style` and `requireForObjectLiteral` options to the lint rule [`useConsistentArrowReturn`](https://biomejs.dev/linter/rules/use-consistent-arrow-return/).
  87. This rule enforces a consistent return style for arrow functions. It can be configured with the following options:
  88. - `style`: (default: `asNeeded`)
  89. - `always`: enforces that arrow functions always have a block body.
  90. - `never`: enforces that arrow functions never have a block body, when possible.
  91. - `asNeeded`: enforces that arrow functions have a block body only when necessary (e.g. for object literals).
  92. #### `style: "always"`
  93. Invalid:
  94. ```js
  95. const f = () => 1;
  96. ```
  97. Valid:
  98. ```js
  99. const f = () => {
  100. return 1;
  101. };
  102. ```
  103. #### `style: "never"`
  104. Invalid:
  105. ```js
  106. const f = () => {
  107. return 1;
  108. };
  109. ```
  110. Valid:
  111. ```js
  112. const f = () => 1;
  113. ```
  114. #### `style: "asNeeded"`
  115. Invalid:
  116. ```js
  117. const f = () => {
  118. return 1;
  119. };
  120. ```
  121. Valid:
  122. ```js
  123. const f = () => 1;
  124. ```
  125. #### `style: "asNeeded"` and `requireForObjectLiteral: true`
  126. Valid:
  127. ```js
  128. const f = () => {
  129. return { a: 1 };
  130. };
  131. ```
  132. - [#7510](https://github.com/biomejs/biome/pull/7510) [`527cec2`](https://github.com/biomejs/biome/commit/527cec2ca10df23754e9958d17baefca6a559154) Thanks [@rriski](https://github.com/rriski)! - Implements [#7339](https://github.com/biomejs/biome/discussions/7339). GritQL patterns can now use native Biome AST nodes using their `PascalCase` names, in addition to the existing TreeSitter-compatible `snake_case` names.
  133. ```grit
  134. engine biome(1.0)
  135. language js(typescript,jsx)
  136. or {
  137. // TreeSitter-compatible pattern
  138. if_statement(),
  139. // Native Biome AST node pattern
  140. JsIfStatement()
  141. } as $stmt where {
  142. register_diagnostic(
  143. span=$stmt,
  144. message="Found an if statement"
  145. )
  146. }
  147. ```
  148. - [#7574](https://github.com/biomejs/biome/pull/7574) [`47907e7`](https://github.com/biomejs/biome/commit/47907e7d9badbe0c41c6a23bdd962676de216db0) Thanks [@kedevked](https://github.com/kedevked)! - Fixed [7574](https://github.com/biomejs/biome/pull/7574). The diagnostic message for the rule `useSolidForComponent` now correctly emphasizes `<For />` and provides a working hyperlink to the Solid documentation.
  149. - [#7497](https://github.com/biomejs/biome/pull/7497) [`bd70f40`](https://github.com/biomejs/biome/commit/bd70f40cb933c1df0c171a9048b62da432093308) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#7320](https://github.com/biomejs/biome/issues/7320): The [`useConsistentCurlyBraces`](https://biomejs.dev/linter/rules/use-consistent-curly-braces/) rule now correctly detects a string literal including `"` inside a JSX attribute value.
  150. - [#7522](https://github.com/biomejs/biome/pull/7522) [`1af9931`](https://github.com/biomejs/biome/commit/1af993134ba2d9158f6824c2f002c90133c0e3f4) Thanks [@Netail](https://github.com/Netail)! - Added extra references to external rules to improve migration for the following rules: `noUselessFragments` & `noNestedComponentDefinitions`
  151. - [#7597](https://github.com/biomejs/biome/pull/7597) [`5c3d542`](https://github.com/biomejs/biome/commit/5c3d542e65fee652dc4e52f3ec2de0441c3f3aec) Thanks [@arendjr](https://github.com/arendjr)! - Fixed an issue where `package.json` manifests would not be correctly discovered
  152. when evaluating files in the same directory.
  153. - [#7565](https://github.com/biomejs/biome/pull/7565) [`38d2098`](https://github.com/biomejs/biome/commit/38d2098bb3a81adaf73a19807c1e62d352405764) Thanks [@siketyan](https://github.com/siketyan)! - The resolver can now correctly resolve `.ts`, `.tsx`, `.d.ts`, `.js` files by `.js` extension if exists, based on [the file extension substitution in TypeScript](https://www.typescriptlang.org/docs/handbook/modules/reference.html#file-extension-substitution).
  154. For example, the linter can now detect the floating promise in the following situation, if you have enabled the `noFloatingPromises` rule.
  155. **`foo.ts`**
  156. ```ts
  157. export async function doSomething(): Promise<void> {}
  158. ```
  159. **`bar.ts`**
  160. ```ts
  161. import { doSomething } from "./foo.js"; // doesn't exist actually, but it is resolved to `foo.ts`
  162. doSomething(); // floating promise!
  163. ```
  164. - [#7542](https://github.com/biomejs/biome/pull/7542) [`cadad2c`](https://github.com/biomejs/biome/commit/cadad2cadbd3852873cbd3f721c26ae7ceb3f39a) Thanks [@mdevils](https://github.com/mdevils)! - Added the rule [`noVueDuplicateKeys`](https://biomejs.dev/linter/rules/no-vue-duplicate-keys/), which prevents duplicate keys in Vue component definitions.
  165. This rule prevents the use of duplicate keys across different Vue component options such as `props`, `data`, `computed`, `methods`, and `setup`. Even if keys don't conflict in the script tag, they may cause issues in the template since Vue allows direct access to these keys.
  166. ##### Invalid examples
  167. ```vue
  168. <script>
  169. export default {
  170. props: ["foo"],
  171. data() {
  172. return {
  173. foo: "bar",
  174. };
  175. },
  176. };
  177. </script>
  178. ```
  179. ```vue
  180. <script>
  181. export default {
  182. data() {
  183. return {
  184. message: "hello",
  185. };
  186. },
  187. methods: {
  188. message() {
  189. console.log("duplicate key");
  190. },
  191. },
  192. };
  193. </script>
  194. ```
  195. ```vue
  196. <script>
  197. export default {
  198. computed: {
  199. count() {
  200. return this.value * 2;
  201. },
  202. },
  203. methods: {
  204. count() {
  205. this.value++;
  206. },
  207. },
  208. };
  209. </script>
  210. ```
  211. ##### Valid examples
  212. ```vue
  213. <script>
  214. export default {
  215. props: ["foo"],
  216. data() {
  217. return {
  218. bar: "baz",
  219. };
  220. },
  221. methods: {
  222. handleClick() {
  223. console.log("unique key");
  224. },
  225. },
  226. };
  227. </script>
  228. ```
  229. ```vue
  230. <script>
  231. export default {
  232. computed: {
  233. displayMessage() {
  234. return this.message.toUpperCase();
  235. },
  236. },
  237. methods: {
  238. clearMessage() {
  239. this.message = "";
  240. },
  241. },
  242. };
  243. </script>
  244. ```
  245. - [#7546](https://github.com/biomejs/biome/pull/7546) [`a683acc`](https://github.com/biomejs/biome/commit/a683acc30bf85d1337760aa1500eb892ebc8e0ac) Thanks [@siketyan](https://github.com/siketyan)! - Internal data for Unicode strings have been updated to Unicode 17.0.
  246. - [#7497](https://github.com/biomejs/biome/pull/7497) [`bd70f40`](https://github.com/biomejs/biome/commit/bd70f40cb933c1df0c171a9048b62da432093308) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#7256](https://github.com/biomejs/biome/issues/7256): The [`useConsistentCurlyBraces`](https://biomejs.dev/linter/rules/use-consistent-curly-braces/) rule now correctly ignores a string literal with braces that contains only whitespaces. Previously, literals that contains single whitespace were only allowed.
  247. - [#7565](https://github.com/biomejs/biome/pull/7565) [`38d2098`](https://github.com/biomejs/biome/commit/38d2098bb3a81adaf73a19807c1e62d352405764) Thanks [@siketyan](https://github.com/siketyan)! - The [`useImportExtensions`](https://biomejs.dev/linter/rules/use-import-extensions/) rule now correctly detects imports with an invalid extension. For example, importing `.ts` file with `.js` extension is flagged by default. If you are using TypeScript with neither the `allowImportingTsExtensions` option nor the `rewriteRelativeImportExtensions` option, it's recommended to turn on the `forceJsExtensions` option of the rule.
  248. - [#7581](https://github.com/biomejs/biome/pull/7581) [`8653921`](https://github.com/biomejs/biome/commit/86539215dde0c29eae0a6975b442637048a8673b) Thanks [@lucasweng](https://github.com/lucasweng)! - Fixed [#7470](https://github.com/biomejs/biome/issues/7470): solved a false positive for [`noDuplicateProperties`](https://biomejs.dev/linter/rules/no-duplicate-properties/). Previously, declarations in `@container` and `@starting-style` at-rules were incorrectly flagged as duplicates of identical declarations at the root selector.
  249. For example, the linter no longer flags the `display` declaration in `@container` or the `opacity` declaration in `@starting-style`.
  250. ```css
  251. a {
  252. display: block;
  253. @container (min-width: 600px) {
  254. display: none;
  255. }
  256. }
  257. [popover]:popover-open {
  258. opacity: 1;
  259. @starting-style {
  260. opacity: 0;
  261. }
  262. }
  263. ```
  264. - [#7529](https://github.com/biomejs/biome/pull/7529) [`fea905f`](https://github.com/biomejs/biome/commit/fea905f0af9fc992a17fe1dcdbc3e0e63fae9d65) Thanks [@qraqras](https://github.com/qraqras)! - Fixed [#7517](https://github.com/biomejs/biome/issues/7517): the [`useOptionalChain`](https://biomejs.dev/linter/rules/use-optional-chain/) rule no longer suggests changes for typeof checks on global objects.
  265. ```ts
  266. // ok
  267. typeof window !== "undefined" && window.location;
  268. ```
  269. - [#7476](https://github.com/biomejs/biome/pull/7476) [`c015765`](https://github.com/biomejs/biome/commit/c015765af2defb042285d96588fcb5f531eb8b6f) Thanks [@ematipico](https://github.com/ematipico)! - Fixed a bug where the suppression action for `noPositiveTabindex` didn't place the suppression comment in the correct position.
  270. - [#7511](https://github.com/biomejs/biome/pull/7511) [`a0039fd`](https://github.com/biomejs/biome/commit/a0039fd5457d0df18242feed5d21ff868ceb0693) Thanks [@arendjr](https://github.com/arendjr)! - Added nursery rule [`noUnusedExpressions`](https://biomejs.dev/linter/rules/no-unused-expressions/) to flag expressions used as a statement that is neither an assignment nor a function call.
  271. #### Invalid examples
  272. ```js
  273. f; // intended to call `f()` instead
  274. ```
  275. ```js
  276. function foo() {
  277. 0; // intended to `return 0` instead
  278. }
  279. ```
  280. #### Valid examples
  281. ```js
  282. f();
  283. ```
  284. ```js
  285. function foo() {
  286. return 0;
  287. }
  288. ```
  289. - [#7564](https://github.com/biomejs/biome/pull/7564) [`40e515f`](https://github.com/biomejs/biome/commit/40e515f73275ad0023ec03e95551a3bbb79b84a1) Thanks [@turbocrime](https://github.com/turbocrime)! - Fixed [#6617](https://github.com/biomejs/biome/issues/6617): improved [`useIterableCallbackReturn`](https://biomejs.dev/linter/rules/use-iterable-callback-return/) to correctly handle arrow functions with a single-expression `void` body.
  290. Now the following code doesn't trigger the rule anymore:
  291. ```js
  292. [].forEach(() => void null);
  293. ```
  294. ## What's Changed
  295. * chore: add spanish readme translation by @Terraciano in https://github.com/biomejs/biome/pull/7465
  296. * feat(yaml_parser): parse block scalars by @l0ngvh in https://github.com/biomejs/biome/pull/7417
  297. * docs: improve noDuplicateDependencies by @Netail in https://github.com/biomejs/biome/pull/7471
  298. * chore: repair changelog by @ematipico in https://github.com/biomejs/biome/pull/7477
  299. * fix(noPositiveTabindex): suppression action by @ematipico in https://github.com/biomejs/biome/pull/7476
  300. * fix(lint/useConsistentCurlyBraces): adjust condition to allow removing the braces by @siketyan in https://github.com/biomejs/biome/pull/7497
  301. * fix(lint/useExhaustiveDependencies): correctly fix the dependency list from a shorthand object member by @siketyan in https://github.com/biomejs/biome/pull/7498
  302. * chore(deps): update rust:1.89.0-bullseye docker digest to 8f72d97 by @renovate[bot] in https://github.com/biomejs/biome/pull/7506
  303. * chore(deps): update rust:1.89.0-bookworm docker digest to 948f9b0 by @renovate[bot] in https://github.com/biomejs/biome/pull/7505
  304. * chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/7503
  305. * chore(deps): update docker/dockerfile:1 docker digest to dabfc09 by @renovate[bot] in https://github.com/biomejs/biome/pull/7502
  306. * chore(deps): update dependency @changesets/cli to v2.29.7 by @renovate[bot] in https://github.com/biomejs/biome/pull/7507
  307. * chore(deps): update dependency dprint to v0.50.2 by @renovate[bot] in https://github.com/biomejs/biome/pull/7508
  308. * feat(biome-js-analyze): class member references service by @vladimir-ivanov in https://github.com/biomejs/biome/pull/7428
  309. * feat(grit): allow matching native Biome AST nodes by @rriski in https://github.com/biomejs/biome/pull/7510
  310. * feat(linter): implement `noUnusedExpressions` by @arendjr in https://github.com/biomejs/biome/pull/7511
  311. * feat(linter): implement `noDeprecatedImports` by @arendjr in https://github.com/biomejs/biome/pull/7520
  312. * chore: expose preferred indentation by @arendjr in https://github.com/biomejs/biome/pull/7540
  313. * chore: update Unicode table for Unicode 17 by @siketyan in https://github.com/biomejs/biome/pull/7546
  314. * ci: don't run the autofix workflow on an autofix commit by @siketyan in https://github.com/biomejs/biome/pull/7550
  315. * test: fix failing watcher tests on macOS by @siketyan in https://github.com/biomejs/biome/pull/7549
  316. * chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/7554
  317. * chore(deps): update rust crate anyhow to 1.0.100 by @renovate[bot] in https://github.com/biomejs/biome/pull/7555
  318. * chore(deps): update rust crate serde_json to 1.0.145 by @renovate[bot] in https://github.com/biomejs/biome/pull/7558
  319. * chore(deps): update rust crate tracing-subscriber to 0.3.20 by @renovate[bot] in https://github.com/biomejs/biome/pull/7560
  320. * chore(deps): update rust crate url to 2.5.7 by @renovate[bot] in https://github.com/biomejs/biome/pull/7561
  321. * chore(deps): update rust crate serde to 1.0.226 by @renovate[bot] in https://github.com/biomejs/biome/pull/7557
  322. * chore(deps): update dependency @types/node to v22.18.6 by @renovate[bot] in https://github.com/biomejs/biome/pull/7563
  323. * chore: add convex to bronze sponsors by @ematipico in https://github.com/biomejs/biome/pull/7566
  324. * feat(resolver): resolve extension alias by @siketyan in https://github.com/biomejs/biome/pull/7565
  325. * feat(lint): add `noReactForwardRef` rule by @siketyan in https://github.com/biomejs/biome/pull/7509
  326. * perf: don't allocate when pushing or retrieving globals by @arendjr in https://github.com/biomejs/biome/pull/7569
  327. * feat: add useConsistentArrowReturn options by @kedevked in https://github.com/biomejs/biome/pull/7457
  328. * fix: set correct string for diagnostic by @kedevked in https://github.com/biomejs/biome/pull/7574
  329. * feat(lint): implement `noVueDuplicateKeys` rule by @mdevils in https://github.com/biomejs/biome/pull/7542
  330. * chore: add edition 2024 to rustfmt.toml by @turbocrime in https://github.com/biomejs/biome/pull/7591
  331. * fix(lint/suspicious/useIterableCallbackReturn): single-expression void arrow function by @turbocrime in https://github.com/biomejs/biome/pull/7564
  332. * fix(noDuplicateProperties): false positives in `@container` and `@starting-style` at-rules by @lucasweng in https://github.com/biomejs/biome/pull/7581
  333. * fix(lint/complexity/noUselessFragments): address inconsistencies against ESLint behavior with fragments only containing text. by @CDGardner in https://github.com/biomejs/biome/pull/7269
  334. * fix(linter): fix aliased paths in `useImportExtensions` by @arendjr in https://github.com/biomejs/biome/pull/7597
  335. * feat(biome-js-analyze): add is_meaningful_read to semantic class reads by @vladimir-ivanov in https://github.com/biomejs/biome/pull/7543
  336. * fix(lint/useOptionalChain): fix incorrect suggestions for `typeof` checks on global objects by @qraqras in https://github.com/biomejs/biome/pull/7529
  337. * chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/7611
  338. * docs: extra rule sources by @Netail in https://github.com/biomejs/biome/pull/7522
  339. * chore(deps): update rust crate libc to 0.2.176 by @renovate[bot] in https://github.com/biomejs/biome/pull/7612
  340. * docs: fix correct graphql references by @Netail in https://github.com/biomejs/biome/pull/7623
  341. * ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/7478
  342. ## New Contributors
  343. * @Terraciano made their first contribution in https://github.com/biomejs/biome/pull/7465
  344. * @turbocrime made their first contribution in https://github.com/biomejs/biome/pull/7591
  345. * @CDGardner made their first contribution in https://github.com/biomejs/biome/pull/7269
  346. **Full Changelog**: https://github.com/biomejs/biome/compare/@biomejs/biome@2.2.4...@biomejs/biome@2.2.5

view on githubimported 2026-09-28 via npm