Zum Inhalt springen
verdict:

Biome 2.4.0

notable

note: die Zusammenfassung und die Release Notes sind auf Englisch

note: keine Zusammenfassung für dieses ältere Release

Wir fassen die neueren Releases zusammen. Die originalen Release Notes dieser Version stehen hier unten.

release-notesgithub.com/biomejs/biome · 959 Zeilen
  1. ## 2.4.0
  2. ### Minor Changes
  3. - [#8964](https://github.com/biomejs/biome/pull/8964) [`0353fa0`](https://github.com/biomejs/biome/commit/0353fa0132ee683073b3f00ca51d53a914d11038) Thanks [@dyc3](https://github.com/dyc3)! - Added `ignore` option to the [`useHookAtTopLevel`](https://biomejs.dev/linter/rules/use-hook-at-top-level/) rule.
  4. You can now specify function names that should not be treated as hooks, even if they follow the `use*` naming convention.
  5. Example configuration:
  6. ```json
  7. {
  8. "linter": {
  9. "rules": {
  10. "correctness": {
  11. "useHookAtTopLevel": {
  12. "options": {
  13. "ignore": ["useDebounce", "useCustomUtility"]
  14. }
  15. }
  16. }
  17. }
  18. }
  19. }
  20. ```
  21. - [#8769](https://github.com/biomejs/biome/pull/8769) [`d0358b0`](https://github.com/biomejs/biome/commit/d0358b0c96dfd014973e5336fc7ebfb8c68affb2) Thanks [@rahuld109](https://github.com/rahuld109)! - Added the rule [`useAnchorContent`](https://biomejs.dev/linter/rules/use-anchor-content/) for HTML to enforce that anchor elements have accessible content for screen readers. The rule flags empty anchors, anchors with only whitespace, and anchors where all content is hidden with `aria-hidden`. Anchors with `aria-label` or `title` attributes providing a non-empty accessible name are considered valid.
  22. - [#8742](https://github.com/biomejs/biome/pull/8742) [`6340ce6`](https://github.com/biomejs/biome/commit/6340ce62c850b727b11c62a4886b94bc25dac05c) Thanks [@rahuld109](https://github.com/rahuld109)! - Added the rule [`useMediaCaption`](https://biomejs.dev/linter/rules/use-media-caption/) to the HTML language. Enforces that `audio` and `video` elements have a `track` element with `kind="captions"` for accessibility. Muted videos are allowed without captions.
  23. - [#8621](https://github.com/biomejs/biome/pull/8621) [`d11130b`](https://github.com/biomejs/biome/commit/d11130b202b5db7219d28ade03bc55e02812de20) Thanks [@Netail](https://github.com/Netail)! - Added support for multiple reporters, and the ability to save reporters on arbitrary files.
  24. #### Combine two reporters in CI
  25. If you run Biome on GitHub, take advantage of the reporter and still see the errors in console, you can now use both reporters:
  26. ```shell
  27. biome ci --reporter=default --reporter=github
  28. ```
  29. #### Save reporter output to a file
  30. With the new `--reporter-file` CLI option, it's now possible to save the output of all reporters to a file. The file is a path,
  31. so you can pass a relative or an absolute path:
  32. ```shell
  33. biome ci --reporter=rdjson --reporter-file=/etc/tmp/report.json
  34. biome ci --reporter=summary --reporter-file=./reports/file.txt
  35. ```
  36. You can combine these two features. For example, have the `default` reporter written on terminal, and the `rdjson` reporter written on file:
  37. ```shell
  38. biome ci --reporter=default --reporter=rdjson --reporter-file=/etc/tmp/report.json
  39. ```
  40. **The `--reporter` and `--reporter-file` flags must appear next to each other, otherwise an error is thrown.**
  41. - [#8399](https://github.com/biomejs/biome/pull/8399) [`ab88099`](https://github.com/biomejs/biome/commit/ab8809959c3dfeeb21d02528edaa3f8637de749a) Thanks [@ematipico](https://github.com/ematipico)! - The Biome CSS parser is now able to parse Vue SFC syntax such as `:slotted` and `:deep`. These pseudo functions are only correctly parsed when the CSS is defined inside `.vue` components. Otherwise, Biome will a emit a parse error.
  42. This capability is only available when `experimentalFullHtmlSupportedEnabled` is set to `true`.
  43. - [#8663](https://github.com/biomejs/biome/pull/8663) [`3dfea16`](https://github.com/biomejs/biome/commit/3dfea169c7632b59fa6fdca3593802dd8fc9948a) Thanks [@ematipico](https://github.com/ematipico)! - Added support for Cursor files. When Biome sees a Cursor JSON file, it will parse it with comments enabled and trailing commas enabled:
  44. - `$PROJECT/.cursor/`
  45. - `%APPDATA%\Cursor\User\` on Windows
  46. - `~/Library/Application Support/Cursor/User/` on macOS
  47. - `~/.config/Cursor/User/` on Linux
  48. - [#8723](https://github.com/biomejs/biome/pull/8723) [`fe2c642`](https://github.com/biomejs/biome/commit/fe2c6427176aeb46b3f1a269be080a2fc80a5643) Thanks [@cbstns](https://github.com/cbstns)! - Added JSON as a target language for GritQL pattern matching. You can now write Grit plugins for JSON files.
  49. This enables users to write GritQL patterns that match against JSON files, useful for:
  50. - Searching and transforming JSON configuration files
  51. - Enforcing patterns in `package.json` and other JSON configs
  52. - Writing custom lint rules for JSON using GritQL
  53. **Example patterns:**
  54. Match all key-value pairs:
  55. ```grit
  56. language json
  57. pair(key = $k, value = $v)
  58. ```
  59. Match objects with specific structure:
  60. ```grit
  61. language json
  62. JsonObjectValue()
  63. ```
  64. Supports both native Biome AST names (`JsonMember`, `JsonObjectValue`) and TreeSitter-compatible names (`pair`, `object`, `array`) for compatibility with existing Grit patterns.
  65. For more details, see the [GritQL documentation](https://biomejs.dev/reference/gritql/).
  66. - [#8814](https://github.com/biomejs/biome/pull/8814) [`4d9c676`](https://github.com/biomejs/biome/commit/4d9c676854990b776d3ec9dc47c7470fd481c4be) Thanks [@Netail](https://github.com/Netail)! - Added `ignore` option to [`noUnknownProperty`](https://biomejs.dev/linter/rules/no-unknown-property). If an unknown property name matches any of the items provided in `ignore`, a diagnostic won't be emitted.
  67. - [#8631](https://github.com/biomejs/biome/pull/8631) [`4d8f19d`](https://github.com/biomejs/biome/commit/4d8f19d56c84783842f66bdc0a78376e18734ab1) Thanks [@Netail](https://github.com/Netail)! - Add a new reporter `--reporter=sarif`, that emits diagnostics using the [SARIF](https://sarifweb.azurewebsites.net/) format.
  68. - [#8270](https://github.com/biomejs/biome/pull/8270) [`4f7909d`](https://github.com/biomejs/biome/commit/4f7909d1155b6ffa9c6d9f7a8fae783f7f7f38da) Thanks [@lucasweng](https://github.com/lucasweng)! - Added the `useIframeTitle` lint rule for HTML. The rule enforces the usage of the `title` attribute for the `iframe` element.
  69. Invalid:
  70. ```html
  71. <iframe></iframe> <iframe title=""></iframe>
  72. ```
  73. Valid:
  74. ```html
  75. <iframe title="title"></iframe>
  76. ```
  77. - [#8164](https://github.com/biomejs/biome/pull/8164) [`1d25856`](https://github.com/biomejs/biome/commit/1d25856483d81a3b8c268ffddd27c1bb00e79710) Thanks [@ematipico](https://github.com/ematipico)! - Added a new assist action `useSortedInterfaceMembers` that sorts TypeScript interface members, for readability.
  78. It includes an autofix.
  79. Invalid example.
  80. ```ts,expect_diagnostic
  81. interface MixedMembers {
  82. z: string;
  83. a: number;
  84. (): void;
  85. y: boolean;
  86. }
  87. ```
  88. Valid example (after using the assist).
  89. ```ts
  90. interface MixedMembers {
  91. a: number;
  92. y: boolean;
  93. z: string;
  94. (): void;
  95. }
  96. ```
  97. - [#8647](https://github.com/biomejs/biome/pull/8647) [`4c7c06f`](https://github.com/biomejs/biome/commit/4c7c06f0db7ab86f7a14df46d3dc2737bccda45b) Thanks [@siketyan](https://github.com/siketyan)! - It's now possible to provide the stacktrace for a fatal error. The stacktrace is only available when the environment variable `RUST_BACKTRACE=1` is set, either via the CLI or exported `$PATH`. This is useful when providing detailed information for debugging purposes:
  98. ```shell
  99. RUST_BACKTRACE=1 biome lint
  100. ```
  101. - [#7961](https://github.com/biomejs/biome/pull/7961) [`a04c8df`](https://github.com/biomejs/biome/commit/a04c8dfbd7b4f45ffc07fbf457d30faa8c1e1b9d) Thanks [@siketyan](https://github.com/siketyan)! - The Biome Language Server now reports progress while scanning files and dependencies in the project.
  102. - [#8289](https://github.com/biomejs/biome/pull/8289) [`a9025d4`](https://github.com/biomejs/biome/commit/a9025d4c560a8c6056dd715fe3eebf772b8f951b) Thanks [@theshadow27](https://github.com/theshadow27)! - Fixed [#8024](https://github.com/biomejs/biome/issues/8024). The rule [`useIterableCallbackReturn`](https://biomejs.dev/linter/rules/use-iterable-callback-return/) now supports a `checkForEach` option. When set to `false`, the rule will skip checking for `forEach()` callbacks for returning values.
  103. - [#8690](https://github.com/biomejs/biome/pull/8690) [`e06e5d1`](https://github.com/biomejs/biome/commit/e06e5d1177837a573fa934f329579c05ce83cd21) Thanks [@ematipico](https://github.com/ematipico)! - Added the rule [`useValidLang`](https://biomejs.dev/linter/rules/use-valid-lang) to the HTML language.
  104. - [#7847](https://github.com/biomejs/biome/pull/7847) [`e90b14f`](https://github.com/biomejs/biome/commit/e90b14f0e6789b4f402bf9621dfa322ebed565ea) Thanks [@Jagget](https://github.com/Jagget)! - Added support for `jsxFactory` and `jsxFragmentFactory`.Biome now respects `jsxFactory` and `jsxFragmentFactory` settings from `tsconfig.json` when using the classic JSX runtime, preventing false positive [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact.
  105. ```json5
  106. // tsconfig.json
  107. {
  108. compilerOptions: {
  109. jsx: "react",
  110. jsxFactory: "h",
  111. jsxFragmentFactory: "Fragment",
  112. },
  113. }
  114. ```
  115. ```jsx
  116. // Component.jsx
  117. import { h, Fragment } from "preact";
  118. function App() {
  119. return <div>Hello</div>;
  120. }
  121. ```
  122. - [#8071](https://github.com/biomejs/biome/pull/8071) [`7f5bcf4`](https://github.com/biomejs/biome/commit/7f5bcf46844405a663d6c399ab3c3275ea6c25a2) Thanks [@ematipico](https://github.com/ematipico)! - Added new CLI options to the commands `lsp-proxy` and `start` that allow to control the Biome file watcher.
  123. #### `--watcher-kind`
  124. Controls how the Biome file watcher should behave. By default, Biome chooses the best watcher strategy for the
  125. current OS, however sometimes this could result in some issues, such as folders locked.
  126. The option accepts the current values:
  127. - `recommended`: the default option, which chooses the best watcher for the current platform.
  128. - `polling`: uses the polling strategy.
  129. - `none`: it doesn't enable the watcher. When the watcher is disabled, changes to files aren't recorded anymore by Biome. This might have
  130. repercussions on some lint rules that might rely on updated types or updated paths.
  131. The environment variable `BIOME_WATCHER_KIND` can be used as alias.
  132. #### `--watcher-polling-interval`
  133. The polling interval in milliseconds. This is only applicable when using the `polling` watcher. It defaults to `2000` milliseconds.
  134. The environment variable `BIOME_WATCHER_POLLING_INTERVAL` can be used as alias.
  135. - [#8262](https://github.com/biomejs/biome/pull/8262) [`4186b83`](https://github.com/biomejs/biome/commit/4186b8324338d357dee94e6343133c8d1ee81a55) Thanks [@lucasweng](https://github.com/lucasweng)! - Added the `useHtmlLang` lint rule for HTML. The rule enforces that the `html` element has a `lang` attribute.
  136. Invalid:
  137. ```html
  138. <html></html>
  139. <html lang></html>
  140. <html lang=""></html>
  141. ```
  142. Valid:
  143. ```html
  144. <html lang="en"></html>
  145. ```
  146. - [#8376](https://github.com/biomejs/biome/pull/8376) [`1a9334c`](https://github.com/biomejs/biome/commit/1a9334c3ebf90863e429ffd9bfe74533514a3f42) Thanks [@siketyan](https://github.com/siketyan)! - Added support for formatting and linting embedded GraphQL snippets in JavaScript.
  147. For example, the following snippets are now formatted:
  148. ```js
  149. import gql from "graphql-tag";
  150. const PeopleCountQuery = gql`
  151. query PeopleCount {
  152. allPeople {
  153. totalCount
  154. }
  155. }
  156. `;
  157. ```
  158. ```js
  159. import { graphql } from "./graphql";
  160. const PeopleCountQuery = graphql(`
  161. query PeopleCount {
  162. allPeople {
  163. totalCount
  164. }
  165. }
  166. `);
  167. ```
  168. This feature is experimental and must be enabled explicitly in the configuration:
  169. ```json
  170. {
  171. "javascript": {
  172. "experimentalEmbeddedSnippetsEnabled": true
  173. }
  174. }
  175. ```
  176. - [#7799](https://github.com/biomejs/biome/pull/7799) [`54682aa`](https://github.com/biomejs/biome/commit/54682aa67abb5014a92291c287afb39c646ae00c) Thanks [@PaulRBerg](https://github.com/PaulRBerg)! - Added `groupByNesting` option to the `useSortedKeys` assist. When enabled, object keys are grouped by their value's nesting depth before sorting alphabetically.
  177. Simple values (primitives, single-line arrays, and single-line objects) are sorted first, followed by nested values (multi-line arrays and multi-line objects).
  178. #### Example
  179. To enable this option, configure it in your `biome.json`:
  180. ```json
  181. {
  182. "linter": {
  183. "rules": {
  184. "source": {
  185. "useSortedKeys": {
  186. "options": {
  187. "groupByNesting": true
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. ```
  195. With this option, the following unsorted object:
  196. ```js
  197. const object = {
  198. name: "Sample",
  199. details: {
  200. description: "nested",
  201. },
  202. id: 123,
  203. };
  204. ```
  205. Will be sorted as:
  206. ```js
  207. const object = {
  208. id: 123,
  209. name: "Sample",
  210. details: {
  211. description: "nested",
  212. },
  213. };
  214. ```
  215. - [#8641](https://github.com/biomejs/biome/pull/8641) [`1dc8dc2`](https://github.com/biomejs/biome/commit/1dc8dc23e06af42af00330e2949db48e987909db) Thanks [@tt-a1i](https://github.com/tt-a1i)! - Added the [`noAutofocus`](https://biomejs.dev/linter/rules/no-autofocus/) lint rule for HTML. This rule enforces that the `autofocus` attribute is not used on elements, as it can cause usability issues for sighted and non-sighted users. The rule allows `autofocus` inside `dialog` elements or elements with the `popover` attribute, as these are modal contexts where autofocus is expected.
  216. - [#8501](https://github.com/biomejs/biome/pull/8501) [`8eb3f19`](https://github.com/biomejs/biome/commit/8eb3f192e4ff534e456b042747e63a6260a50adf) Thanks [@tt-a1i](https://github.com/tt-a1i)! - Added [`noPositiveTabindex`](https://biomejs.dev/linter/rules/no-positive-tabindex/) to HTML. This rule prevents the usage of positive integers on the `tabindex` attribute, which can disrupt natural keyboard navigation order.
  217. - [#8661](https://github.com/biomejs/biome/pull/8661) [`b36ff03`](https://github.com/biomejs/biome/commit/b36ff03b7d2df3b39b30b18e401123b08fabf76a) Thanks [@tt-a1i](https://github.com/tt-a1i)! - Added the [`useAltText`](https://biomejs.dev/linter/rules/use-alt-text/) lint rule for HTML. This rule enforces that elements requiring alternative text (`<img>`, `<area>`, `<input type="image">`, `<object>`) provide meaningful information for screen reader users via `alt`, `title` (for objects), `aria-label`, or `aria-labelledby` attributes. Elements with `aria-hidden="true"` are exempt.
  218. - [#7749](https://github.com/biomejs/biome/pull/7749) [`1c59333`](https://github.com/biomejs/biome/commit/1c59333368e3e28266b2c9557e34c280830b6190) Thanks [@andogq](https://github.com/andogq)! - Implements [#1984](https://github.com/biomejs/biome/issues/1984). Updated [`useHookAtTopLevel`](https://biomejs.dev/linter/rules/use-hook-at-top-level/) to better catch invalid hook usage.
  219. This rule is now capable of finding invalid hook usage in more locations. A diagnostic will now be generated if:
  220. - A hook is used at the module level (top of the file, outside any function).
  221. - A hook is used within a function or method which is not a hook or component, unless it is a function expression (such as arrow functions commonly used in tests).
  222. **Invalid:**
  223. ```js
  224. // Invalid: hooks cannot be called at the module level.
  225. useHook();
  226. ```
  227. ```js
  228. // Invalid: hooks must be called from another hook or component.
  229. function notAHook() {
  230. useHook();
  231. }
  232. ```
  233. **Valid:**
  234. ```js
  235. // Valid: hooks may be called from function expressions, such as in tests.
  236. test("my hook", () => {
  237. renderHook(() => useHook());
  238. renderHook(function () {
  239. return useHook();
  240. });
  241. });
  242. ```
  243. - [#8307](https://github.com/biomejs/biome/pull/8307) [`789b0e7`](https://github.com/biomejs/biome/commit/789b0e7ef610a191d7542f00b232367992f7edc3) Thanks [@mehm8128](https://github.com/mehm8128)! - Added the `useValidAriaRole` lint rule for HTML. The rule enforces that elements with ARIA roles must use a valid, non-abstract ARIA role.
  244. - [#8814](https://github.com/biomejs/biome/pull/8814) [`4d9c676`](https://github.com/biomejs/biome/commit/4d9c676854990b776d3ec9dc47c7470fd481c4be) Thanks [@Netail](https://github.com/Netail)! - Added `ignore` option to [`noUnknownFunction`](https://biomejs.dev/linter/rules/no-unknown-function). If an unknown function name matches any of the items provided in `ignore`, a diagnostic won't be emitted.
  245. - [#8814](https://github.com/biomejs/biome/pull/8814) [`4d9c676`](https://github.com/biomejs/biome/commit/4d9c676854990b776d3ec9dc47c7470fd481c4be) Thanks [@Netail](https://github.com/Netail)! - Added `ignore` option to [`noUnknownPseudoClass`](https://biomejs.dev/linter/rules/no-unknown-pseudo-class). If an unknown pseudo-class name matches any of the items provided in `ignore`, a diagnostic won't be emitted.
  246. - [#8623](https://github.com/biomejs/biome/pull/8623) [`dc1f94e`](https://github.com/biomejs/biome/commit/dc1f94e9449e815b127a8553f0117836328d723e) Thanks [@mldangelo](https://github.com/mldangelo)! - Added the [`noDuplicateClasses`](https://biomejs.dev/assist/actions/no-duplicate-classes/) assist action to detect and remove duplicate CSS classes.
  247. **For JSX files:** Supports `class`, `className` attributes and utility functions like `clsx`, `cn`, `cva`.
  248. **For HTML files:** Checks `class` attributes. This is the first assist action for HTML.
  249. ```jsx
  250. // Before
  251. <div class="flex p-4 flex" />;
  252. // After
  253. <div class="flex p-4" />;
  254. ```
  255. - [#8399](https://github.com/biomejs/biome/pull/8399) [`ab88099`](https://github.com/biomejs/biome/commit/ab8809959c3dfeeb21d02528edaa3f8637de749a) Thanks [@ematipico](https://github.com/ematipico)! - Improved the CSS parser for CSS modules. Biome now automatically enables CSS modules parsing for `*.module.css` files.
  256. If your codebase has only `*.module.css` files, you can remove the parser feature as follows, because now Biome does it for you:
  257. ```diff
  258. {
  259. "css": {
  260. "parser": {
  261. - "cssModules": true
  262. }
  263. }
  264. }
  265. ```
  266. - [#8399](https://github.com/biomejs/biome/pull/8399) [`ab88099`](https://github.com/biomejs/biome/commit/ab8809959c3dfeeb21d02528edaa3f8637de749a) Thanks [@ematipico](https://github.com/ematipico)! - Added support for parsing `:global` and `:local` inside `.astro`, `.svelte` and `.vue` files, in `<style>` portion of the file.
  267. This capability is only available when `experimentalFullHtmlSupportedEnabled` is set to `true`.
  268. - [#9011](https://github.com/biomejs/biome/pull/9011) [`e014336`](https://github.com/biomejs/biome/commit/e0143366bd60eb6f123ea1325135754bf2107f34) Thanks [@ematipico](https://github.com/ematipico)! - Promoted 21 nursery rules to stable groups.
  269. #### Correctness
  270. Promoted the following rules to the `correctness` group:
  271. - [`noUnresolvedImports`](https://biomejs.dev/linter/rules/no-unresolved-imports/). The rule reports imports that cannot be resolved.
  272. The default rule severity is set to `error`.
  273. - [`noVueReservedProps`](https://biomejs.dev/linter/rules/no-vue-reserved-props/). The rule reports Vue reserved props usage.
  274. The default rule severity is set to `error`.
  275. - [`noVueReservedKeys`](https://biomejs.dev/linter/rules/no-vue-reserved-keys/). The rule reports Vue reserved keys usage.
  276. The default rule severity is set to `error`.
  277. - [`noVueDataObjectDeclaration`](https://biomejs.dev/linter/rules/no-vue-data-object-declaration/). The rule reports Vue 2 data declared as an object instead of a function.
  278. The default rule severity is set to `warn`.
  279. - [`noNextAsyncClientComponent`](https://biomejs.dev/linter/rules/no-next-async-client-component/). The rule reports async Next.js client components.
  280. The default rule severity is set to `warn`.
  281. - [`noVueDuplicateKeys`](https://biomejs.dev/linter/rules/no-vue-duplicate-keys/). The rule reports duplicate keys in Vue component options.
  282. The default rule severity is set to `error`.
  283. - [`noVueSetupPropsReactivityLoss`](https://biomejs.dev/linter/rules/no-vue-setup-props-reactivity-loss/). The rule reports destructuring of props in Vue 3 setup which causes reactivity loss.
  284. The default rule severity is set to `error`.
  285. - [`useQwikMethodUsage`](https://biomejs.dev/linter/rules/use-qwik-method-usage/). The rule enforces correct Qwik framework method usage.
  286. The default rule severity is set to `error`.
  287. - [`useQwikValidLexicalScope`](https://biomejs.dev/linter/rules/use-qwik-valid-lexical-scope/). The rule enforces valid lexical scope in Qwik framework.
  288. The default rule severity is set to `error`.
  289. #### Suspicious
  290. Promoted the following rules to the `suspicious` group:
  291. - [`noImportCycles`](https://biomejs.dev/linter/rules/no-import-cycles/). The rule reports circular imports.
  292. The default rule severity is set to `warn`.
  293. - [`noDeprecatedImports`](https://biomejs.dev/linter/rules/no-deprecated-imports/). The rule reports imports of deprecated symbols.
  294. The default rule severity is set to `warn`.
  295. - [`noReactForwardRef`](https://biomejs.dev/linter/rules/no-react-forward-ref/). The rule reports usage of `React.forwardRef`.
  296. The default rule severity is set to `warn`.
  297. - [`noUnusedExpressions`](https://biomejs.dev/linter/rules/no-unused-expressions/). The rule reports expressions that are never used.
  298. The default rule severity is set to `warn`.
  299. - [`noEmptySource`](https://biomejs.dev/linter/rules/no-empty-source/). The rule reports empty source files.
  300. The default rule severity is set to `warn`.
  301. - [`useDeprecatedDate`](https://biomejs.dev/linter/rules/use-deprecated-date/). The rule enforces use of GraphQL `@deprecated` directive with date.
  302. The default rule severity is set to `warn`.
  303. - [`noDuplicateDependencies`](https://biomejs.dev/linter/rules/no-duplicate-dependencies/). The rule reports duplicate dependencies in package.json.
  304. The default rule severity is set to `warn`.
  305. #### Complexity
  306. Promoted the following rules to the `complexity` group:
  307. - [`noUselessUndefined`](https://biomejs.dev/linter/rules/no-useless-undefined/). The rule reports useless `undefined` initialization and returns.
  308. The default rule severity is set to `info`.
  309. - [`useMaxParams`](https://biomejs.dev/linter/rules/use-max-params/). The rule enforces a maximum number of function parameters.
  310. The default rule severity is set to `warn`.
  311. - [`noUselessCatchBinding`](https://biomejs.dev/linter/rules/no-useless-catch-binding/). The rule reports useless catch binding parameters.
  312. The default rule severity is set to `info`.
  313. #### Style
  314. Promoted the following rules to the `style` group:
  315. - [`useConsistentArrowReturn`](https://biomejs.dev/linter/rules/use-consistent-arrow-return/). The rule enforces consistent return in arrow functions.
  316. The default rule severity is set to `info`.
  317. - [`noJsxLiterals`](https://biomejs.dev/linter/rules/no-jsx-literals/). The rule reports literal strings in JSX.
  318. The default rule severity is set to `info`.
  319. - [#8695](https://github.com/biomejs/biome/pull/8695) [`d8f0309`](https://github.com/biomejs/biome/commit/d8f03099e6e712f63599914a6498fb2b1d90243c) Thanks [@ematipico](https://github.com/ematipico)! - Added support for the top-level suppression comment `biome-ignore-all format: <explanation>`.
  320. When the comment `biome-ignore-all format: <explanation>` is placed at the beginning of the document, Biome won't format the code.
  321. The feature works for all supported languages. In the following JavaScript snippet, the code isn't formatted and will stay as is.
  322. ```js
  323. // biome-ignore-all format: generated
  324. const a = [];
  325. const a = [];
  326. const a = [];
  327. ```
  328. - [#8255](https://github.com/biomejs/biome/pull/8255) [`da85e3c`](https://github.com/biomejs/biome/commit/da85e3ca2dd2521c89f9191d2d62172acdb52ae2) Thanks [@ryan-m-walker](https://github.com/ryan-m-walker)! - Added support for the typed `attr` function. Addresses issue #6183.
  329. **Example**
  330. ```css
  331. .btn {
  332. width: attr(data-size type(<length> | <percentage>), 0px);
  333. }
  334. ```
  335. - [#8165](https://github.com/biomejs/biome/pull/8165) [`e0b3f62`](https://github.com/biomejs/biome/commit/e0b3f626231339293f841fda9a060bb4948d9aac) Thanks [@lucasweng](https://github.com/lucasweng)! - Added the `noAccessKey` lint rule for HTML. The rule enforces that the `accesskey` attribute is not used on any HTML element, as it can conflict with keyboard commands used by screen readers and keyboard-only users.
  336. Invalid:
  337. ```html
  338. <input type="submit" accesskey="s" value="Submit" />
  339. <a href="https://webaim.org/" accesskey="w">WebAIM.org</a>
  340. <button accesskey="n">Next</button>
  341. ```
  342. Valid:
  343. ```html
  344. <input type="submit" value="Submit" />
  345. <a href="https://webaim.org/">WebAIM.org</a>
  346. <button>Next</button>
  347. ```
  348. - [#8278](https://github.com/biomejs/biome/pull/8278) [`7207eff`](https://github.com/biomejs/biome/commit/7207eff718f850c261849afd29c2b1ebefc2d52c) Thanks [@ematipico](https://github.com/ematipico)! - Added a feature that allows editors to inject a Biome configuration to the Biome Language Server without affecting the configuration of the project.
  349. If you have a Biome extension that is compatible with your preferred LSP-ready editor, you can map `inlineConfig`. The configuration will be merged with the configuration of the project (or the default configuration):
  350. For example, with the Zed editor, you would have the following configuration, which will format all files using four spaces as indentation style:
  351. ```json5
  352. // .zed/settings.json
  353. {
  354. lsp: {
  355. biome: {
  356. settings: {
  357. inline_config: {
  358. formatter: {
  359. indentStyle: "space",
  360. indentWidth: 4,
  361. },
  362. },
  363. },
  364. },
  365. },
  366. }
  367. ```
  368. - [#8368](https://github.com/biomejs/biome/pull/8368) [`8aa5f5b`](https://github.com/biomejs/biome/commit/8aa5f5b1cb27beee67b0fe579575e570f28e1d45) Thanks [@Bertie690](https://github.com/Bertie690)! - Added 2 options from `typescript-eslint` (`ignoreDifferentlyNamedParameters` and `ignoreDifferentJsDoc`) to [`useUnifiedTypeSignatures`](https://biomejs.dev/linter/rules/use-unified-type-signatures/).
  369. Each option makes the rule ignore overload signatures whose parameter names or JSDoc comments differ.
  370. #### Examples
  371. Valid code with `ignoreDifferentlyNamedParameters` set to `true`:
  372. ```ts
  373. function cook(scoops: IceCreamScoop[]): void;
  374. function cook(cakeType: string): void;
  375. ```
  376. Valid code with `ignoreDifferentJsDoc` set to `true`:
  377. ```ts
  378. /** Does objs have "cow" inside it? */
  379. function hasCow(objs: string[]): boolean;
  380. /** @deprecated - convert to array */
  381. function hasCow(objs: string): boolean;
  382. ```
  383. - [#8562](https://github.com/biomejs/biome/pull/8562) [`361350e`](https://github.com/biomejs/biome/commit/361350e6549fe67baec80bdf931648f872e0647c) Thanks [@dyc3](https://github.com/dyc3)! - Added the rule profiler behind the `--profile-rules` cli flag. You can now see a report of which lint rules took the longest to execute.
  384. - [#8234](https://github.com/biomejs/biome/pull/8234) [`e2e6e66`](https://github.com/biomejs/biome/commit/e2e6e6618e54c048a1be8adb8067d7f115e245d7) Thanks [@ongyuxing](https://github.com/ongyuxing)! - Updated the CSS properties ordering to align with `stylelint-config-recess-order` v7.4.0.
  385. It adds support for:
  386. - Containment properties
  387. - Font synthesis properties
  388. - Ruby properties
  389. - Color adjustment properties
  390. - View transitions properties
  391. - Shapes properties
  392. - Motion path properties
  393. - etc.
  394. For the complete list of changes, see: https://github.com/stormwarning/stylelint-config-recess-order/compare/v6.0.0...v7.4.0.
  395. - [#8814](https://github.com/biomejs/biome/pull/8814) [`4d9c676`](https://github.com/biomejs/biome/commit/4d9c676854990b776d3ec9dc47c7470fd481c4be) Thanks [@Netail](https://github.com/Netail)! - Added `ignore` option to [`noUnknownPseudoElement`](https://biomejs.dev/linter/rules/no-unknown-selector-pseudo-element). If an unknown pseudo-element name matches any of the items provided in `ignore`, a diagnostic won't be emitted.
  396. - [#8663](https://github.com/biomejs/biome/pull/8663) [`3dfea16`](https://github.com/biomejs/biome/commit/3dfea169c7632b59fa6fdca3593802dd8fc9948a) Thanks [@ematipico](https://github.com/ematipico)! - Added the ability to load the configuration from new known paths. Biome now attempts to load the configuration files
  397. from the following locations:
  398. - `$XDG_CONFIG_HOME` or `$HOME/.config/biome` on Linux
  399. - `/Users/$USER/Library/Application Support/biome` on macOS
  400. - `C:\Users\$USER\AppData\Roaming\biome\config` on Windows
  401. The priority how Biome will attempt to load the configuration files is the following:
  402. 1. project folder (working directory)
  403. 2. parent folders
  404. 3. config home
  405. 1. `$XDG_CONFIG_HOME` or `$HOME/.config/biome` on Linux
  406. 2. `/Users/$USER/Library/Application Support/biome` on macOS
  407. 3. `C:\Users\$USER\AppData\Roaming\biome\config` on Windows
  408. - [#7973](https://github.com/biomejs/biome/pull/7973) [`bc0e8b4`](https://github.com/biomejs/biome/commit/bc0e8b47a276efabb0b76169d13dfc9d5325953f) Thanks [@siketyan](https://github.com/siketyan)! - Added support for formatting and linting embedded CSS snippets in JavaScript.
  409. For example, the following snippets are now formatted and linted:
  410. ```js
  411. import styled from "styled-components";
  412. const Foo = styled.div`
  413. display: flex;
  414. color: red;
  415. `;
  416. ```
  417. ```js
  418. import styled from "@emotion/styled";
  419. const Foo = styled(Box)`
  420. display: flex;
  421. color: red;
  422. `;
  423. ```
  424. ```js
  425. import { css } from "@emotion/react";
  426. const style = css`
  427. display: flex;
  428. color: red;
  429. `;
  430. ```
  431. However, snippets with interpolations are not supported yet. For example, the following snippet **isn't** formatted:
  432. ```ts
  433. import styled from "@emotion/styled";
  434. const Foo = styled.div<{ color: string }>`
  435. display: flex;
  436. color: ${(props) => props.color};
  437. `;
  438. ```
  439. This feature is experimental and must be enabled explicitly in the configuration:
  440. ```json
  441. {
  442. "javascript": {
  443. "experimentalEmbeddedSnippetsEnabled": true
  444. }
  445. }
  446. ```
  447. - [#8381](https://github.com/biomejs/biome/pull/8381) [`50c3513`](https://github.com/biomejs/biome/commit/50c351357e4400c3c1890fc2e10a11a37c8fca49) Thanks [@mehm8128](https://github.com/mehm8128)! - Added the `useAriaPropsForRole` lint rule for HTML. The rule enforces that elements with ARIA roles must have all required ARIA attributes for that role.
  448. - [#7762](https://github.com/biomejs/biome/pull/7762) [`5901d79`](https://github.com/biomejs/biome/commit/5901d79132178a1ceae2cab3abe94dcced3daff6) Thanks [@dyc3](https://github.com/dyc3)! - Added the `extensionMappings` option to `useImportExtensions`. This allows users to specify custom file extensions for different module types.
  449. For example, if you want to ban all `.ts` imports in favor of `.js` imports, you can now do so with this option:
  450. ```json
  451. {
  452. "options": {
  453. "extensionMappings": {
  454. "ts": "js"
  455. }
  456. }
  457. }
  458. ```
  459. - [#8532](https://github.com/biomejs/biome/pull/8532) [`01bccc8`](https://github.com/biomejs/biome/commit/01bccc8bfe8e54ff0d84728c2d4d6053c68d3ccb) Thanks [@jonaylor89](https://github.com/jonaylor89)! - Added `--only` and `--skip` options to `biome check` and `biome ci`, covering both lint diagnostics and assist actions. Biome now lets you run or exclude specific lint rules, assist actions, group or rules and actions, or domains when running these commands.
  460. Examples:
  461. ```shell
  462. biome check --only=suspicious/noDebugger src/**/*.js
  463. biome ci --skip=project src/**
  464. ```
  465. - [#8666](https://github.com/biomejs/biome/pull/8666) [`7733f90`](https://github.com/biomejs/biome/commit/7733f905be5c48efc90b167232ec39259f9fa6a7) Thanks [@ematipico](https://github.com/ematipico)! - Added the rule [`noRedundantAlt`](https://biomejs.dev/linter/rules/no-redundant-alt/) to HTML. The rule enforces that the `img` element `alt` attribute does not contain the words “image”, “picture”, or “photo”.
  466. - [#8287](https://github.com/biomejs/biome/pull/8287) [`a248e88`](https://github.com/biomejs/biome/commit/a248e887af550d77525c2f9080c62dace79b8f91) Thanks [@mehm8128](https://github.com/mehm8128)! - Added the `noDistractingElements` lint rule for HTML. The rule enforces that no distracting elements like `<marquee>` or `<blink>` are used.
  467. - [#8564](https://github.com/biomejs/biome/pull/8564) [`adcce82`](https://github.com/biomejs/biome/commit/adcce82eaede7d2db2ef95f27a6109b2475595b5) Thanks [@ematipico](https://github.com/ematipico)! - Added the new linter domain `types`. This is a domain that enables all rules that require the type inference engine.
  468. As opposed to the `project` domain, which only enables rules that require the module graph to function.
  469. The following **nursery** rules have been moved to the `types` domain:
  470. - `useArraySortCompare`
  471. - `useAwaitThenable`
  472. - `useFind`
  473. - `useRegexpExec`
  474. - `noUnnecessaryConditions`
  475. - `noMisusedPromises`
  476. - `noFloatingPromises`
  477. - [#8556](https://github.com/biomejs/biome/pull/8556) [`47a79f1`](https://github.com/biomejs/biome/commit/47a79f1b22c0d0577dd23b927a6cf04b17d603e9) Thanks [@mehm8128](https://github.com/mehm8128)! - Added two new behaviors to the `noSvgWithoutTitle` rule.
  478. - Support for `graphics-document` and `graphics-symbol` roles.
  479. - Support for multiple role specifications.
  480. - [#8663](https://github.com/biomejs/biome/pull/8663) [`3dfea16`](https://github.com/biomejs/biome/commit/3dfea169c7632b59fa6fdca3593802dd8fc9948a) Thanks [@ematipico](https://github.com/ematipico)! - Added the ability to load the hidden files `.biome.json` and `.biome.jsonc`. This is the order how Biome will attempt the configuration file is:
  481. 1. `biome.json`
  482. 2. `biome.jsonc`
  483. 3. `.biome.json`
  484. 4. `.biome.jsonc`
  485. - [#8334](https://github.com/biomejs/biome/pull/8334) [`ae8ac8e`](https://github.com/biomejs/biome/commit/ae8ac8e62fb6276e32192875219edf7a6ee463a8) Thanks [@ematipico](https://github.com/ematipico)! - Added the formatter option [`trailingNewline`](https://biomejs.dev/reference/configuration/#formattertrailingnewline).
  486. When set to `false`, the formatter will remove the trailing newline at the end of formatted files. The default value is `true`, which preserves the current behavior of adding a trailing newline.
  487. This option is available globally and for each language-specific formatter configuration:
  488. ```json
  489. {
  490. "formatter": {
  491. "trailingNewline": false
  492. },
  493. "javascript": {
  494. "formatter": {
  495. "trailingNewline": true
  496. }
  497. }
  498. }
  499. ```
  500. The following CLI flags have been added. They accept `true` or `false` as value:
  501. - `--formatter-trailing-newline`
  502. - `--javascript-formatter-trailing-newline`
  503. - `--json-formatter-trailing-newline`
  504. - `--graphql-formatter-trailing-newline`
  505. - `--css-formatter-trailing-newline`
  506. - `--html-formatter-trailing-newline`
  507. - [#8854](https://github.com/biomejs/biome/pull/8854) [`1469968`](https://github.com/biomejs/biome/commit/14699685a0689432d663d1555e404efe2a6a1768) Thanks [@ematipico](https://github.com/ematipico)! - Formatting is now applied when applying safe/unsafe fixes via `biome check`.
  508. - [#8642](https://github.com/biomejs/biome/pull/8642) [`46f33a7`](https://github.com/biomejs/biome/commit/46f33a749ba11f8299a00e9d8a22eac5fa33aa87) Thanks [@ematipico](https://github.com/ematipico)! - Improved the rule `noUnusedVariables` in Svelte files, by correctly detecting variables defined in the JavaScript blocks, and used inside the templates.
  509. - [#8839](https://github.com/biomejs/biome/pull/8839) [`79b38aa`](https://github.com/biomejs/biome/commit/79b38aa9eef36578f32303002bc23b926ff35496) Thanks [@ryan-m-walker](https://github.com/ryan-m-walker)! - Added support for parsing and formatting the CSS `@function` at-rule from the [CSS Mixins Module Level 1](https://drafts.csswg.org/css-mixins-1/#function-rule) specification. Addresses issue [#8184](https://github.com/biomejs/biome/issues/8184).
  510. ```css
  511. @function --transparent(--color <color>, --alpha <number>: 0.5) returns
  512. <color> {
  513. result: oklch(from var(--color) l c h / var(--alpha));
  514. }
  515. ```
  516. - [#8412](https://github.com/biomejs/biome/pull/8412) [`73f4f53`](https://github.com/biomejs/biome/commit/73f4f53ae1fb0318d8f77658fa61757f1792bccc) Thanks [@mehm8128](https://github.com/mehm8128)! - Added the [`noSvgWithoutTitle`](https://biomejs.dev/linter/rules/no-svg-without-title/) lint rule to HTML. The rule enforces the usage of the `title` element for the `svg` element.
  517. - [#8243](https://github.com/biomejs/biome/pull/8243) [`4291ff3`](https://github.com/biomejs/biome/commit/4291ff37f5d782c0c3d1d56fac7f0817bcece498) Thanks [@ashnewmanjones](https://github.com/ashnewmanjones)! - Added the `useButtonType` lint rule for HTML. The rule enforces that the `type` attribute is present and valid on all button elements.
  518. Invalid:
  519. ```html
  520. <button>Do something</button>
  521. <button type="incorrectType">Do something</button>
  522. <button type>Do something</button>
  523. <button type />
  524. ```
  525. Valid:
  526. ```html
  527. <button type="button">Do something</button>
  528. <button type="reset">Do something</button>
  529. <button type="submit" />
  530. ```
  531. ### Patch Changes
  532. - [#8898](https://github.com/biomejs/biome/pull/8898) [`7e48bd4`](https://github.com/biomejs/biome/commit/7e48bd40257eaa4e584d2bb567b0ce8b8d1e0e47) Thanks [@ematipico](https://github.com/ematipico)! - Added e18e ESLint plugin as a recognized rule source. Six Biome rules now reference their e18e equivalents: `useAtIndex`, `useExponentiationOperator`, `noPrototypeBuiltins`, `useDateNow`, `useSpread`, and `useObjectSpread`.
  533. - [#8719](https://github.com/biomejs/biome/pull/8719) [`a215408`](https://github.com/biomejs/biome/commit/a215408715ed0af661c9a95a030773ccdfb13057) Thanks [@ematipico](https://github.com/ematipico)! - Added proper parsing and formatting for Svelte directives when the `html.experimentalFullSupportEnabled` is set to `true`.
  534. - [#8071](https://github.com/biomejs/biome/pull/8071) [`7f5bcf4`](https://github.com/biomejs/biome/commit/7f5bcf46844405a663d6c399ab3c3275ea6c25a2) Thanks [@ematipico](https://github.com/ematipico)! - Revamped the logging options for all Biome commands. Now the commands `format`, `lint`, `check`, `ci`, `search`, `lsp-proxy` and `start` accept the following CLI options.
  535. Some options might have been present before, but they were inconsistent. Plus, all new options have an environment variable as aliases.
  536. #### `--log-file`
  537. Optional path/file to redirect log messages to. This option is applicable only to the CLI. If omitted, logs are printed to stdout.
  538. Environment variable alias: `BIOME_LOG_FILE`
  539. #### `--log-prefix-name`
  540. Allows changing the prefix applied to the file name of the logs. This option is applicable only to the daemon.
  541. Environment variable alias: `BIOME_LOG_PREFIX_NAME`
  542. #### `--log-path`
  543. Allows changing the folder where logs are stored. This option is applicable only to the daemon.
  544. Environment variable alias: `BIOME_LOG_PATH`
  545. #### `--log-level`
  546. The level of logging. In order, from the most verbose to the least verbose: `debug`, `info`, `warn`, `error`
  547. The value `none` won't show any logging.
  548. Environment variable alias: `BIOME_LOG_LEVEL`
  549. #### `--log-kind`
  550. What the log should look like.
  551. Environment variable alias: `BIOME_LOG_KIND`
  552. #### Reduce dumping of LSP logs
  553. When you use a Biome editor extension, Biome's Daemon dumps its logs using the `debug` level. If you want to reduce
  554. the quantity of these logs, you can now customize it:
  555. ```shell
  556. BIOME_LOG_LEVEL=info biome lsp-proxy
  557. ```
  558. - [#8663](https://github.com/biomejs/biome/pull/8663) [`3dfea16`](https://github.com/biomejs/biome/commit/3dfea169c7632b59fa6fdca3593802dd8fc9948a) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#901](https://github.com/biomejs/biome-vscode/issues/901). Biome now allows trailing commas in inside Zed `settings.json` and VSCode `settings.json`.
  559. - [#8669](https://github.com/biomejs/biome/pull/8669) [`683f50d`](https://github.com/biomejs/biome/commit/683f50dff3091d1949d98dddf7ddaf7999cced72) Thanks [@tt-a1i](https://github.com/tt-a1i)! - Fixed [#8628](https://github.com/biomejs/biome/issues/8628): [`useComponentExportOnlyModules`](https://biomejs.dev/linter/rules/use-component-export-only-modules/) now allows components referenced as object property values in exported expressions. This fixes false positives for TanStack Router patterns.
  560. ```jsx
  561. export const Route = createFileRoute('/')({
  562. component: HomeComponent,
  563. })
  564. function HomeComponent() { ... } // no longer reported as "should be exported"
  565. ```
  566. - [#9060](https://github.com/biomejs/biome/pull/9060) [`0e47f5a`](https://github.com/biomejs/biome/commit/0e47f5a6cea7c7c34ec655479377aa0597be9516) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#9057](https://github.com/biomejs/biome/issues/9057): Incorrect diagnostic spans for suppression comments and other raw diagnostics in HTML-ish files (Vue, Svelte, Astro). Previously, diagnostics like "unused suppression" pointed to the wrong location in the document due to the diagnostic offset not being applied.
  567. - [#9028](https://github.com/biomejs/biome/pull/9028) [`5ac2ad6`](https://github.com/biomejs/biome/commit/5ac2ad6c429bae76bde05e5e73f3e3b04c44a45c) Thanks [@LouisLau-art](https://github.com/LouisLau-art)! - Fixed [#9024](https://github.com/biomejs/biome/issues/9024): Biome no longer reports `<hr role="presentation">` under [`noInteractiveElementToNoninteractiveRole`](https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role/).
  568. - [#9072](https://github.com/biomejs/biome/pull/9072) [`8656fc0`](https://github.com/biomejs/biome/commit/8656fc0cd78c46c52fd588e8c03cbf9dc53a51f4) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#9068](https://github.com/biomejs/biome/issues/9068): The `noVueDuplicateKeys` rule now correctly handles `toRefs(props)` patterns and no longer produces false positives when destructuring props, particularly in `<script setup>` blocks.
  569. - [#9049](https://github.com/biomejs/biome/pull/9049) [`c0ab6dd`](https://github.com/biomejs/biome/commit/c0ab6ddb0de1f2477d421c20558227b1b0fd43e5) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [#7138](https://github.com/biomejs/biome/issues/7138). Now the Biome language server correctly handles the `configurationPath` setting coming from the editor extension.
  570. - [#8556](https://github.com/biomejs/biome/pull/8556) [`47a79f1`](https://github.com/biomejs/biome/commit/47a79f1b22c0d0577dd23b927a6cf04b17d603e9) Thanks [@mehm8128](https://github.com/mehm8128)! - Fixed the `noSvgWithoutTitle` rule not to recursively traverse `title` elements.
  571. - [#8894](https://github.com/biomejs/biome/pull/8894) [`6bf1b09`](https://github.com/biomejs/biome/commit/6bf1b09bd670d89e6dfd7ac6b2d3a060fb51f185) Thanks [@ematipico](https://github.com/ematipico)! - Added proper parsing for spread attributes `{...props}` in Svelte and Astro files.
  572. - [#8833](https://github.com/biomejs/biome/pull/8833) [`375792e`](https://github.com/biomejs/biome/commit/375792e7c94db6c676222b0b3ecdb7ad89d4ece6) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#4927](https://github.com/biomejs/biome/issues/4927), [#6407](https://github.com/biomejs/biome/issues/6407): The HTML formatter will now correctly break a block-like element if it has more than 2 children, and at least one of them is another block-like element.
  573. ```diff
  574. -<div>a<div>b</div> c</div>
  575. +<div>
  576. + a
  577. + <div>b</div>
  578. + c
  579. +</div>
  580. ```
  581. - [#8854](https://github.com/biomejs/biome/pull/8854) [`1469968`](https://github.com/biomejs/biome/commit/14699685a0689432d663d1555e404efe2a6a1768) Thanks [@ematipico](https://github.com/ematipico)! - Fixed [`#7912`](https://github.com/biomejs/biome/issues/7912), where Biome incorrectly added a leading newline to the code contained inside the Astro frontmatter.
  582. - [#8806](https://github.com/biomejs/biome/pull/8806) [`cb112ce`](https://github.com/biomejs/biome/commit/cb112ce872c8428414d78bc90c6ed26a102ac0e0) Thanks [@dyc3](https://github.com/dyc3)! - **Major Breaking Changes to the HTML formatter only**
  583. The HTML formatter (which is still experimental) has been completely overhauled from the ground up to more closely resemble Prettier's formatting. If you have opted in to the HTML formatter, you may see large formatting diffs for your HTML, Vue, Svelte, and Astro files.
  584. This overhaul fixes several issues ([#5150](https://github.com/biomejs/biome/issues/5150), [#6625](https://github.com/biomejs/biome/issues/6623), [#8437](https://github.com/biomejs/biome/issues/8437)) around whitespace sensitivity that were causing incorrect formatting in certain scenarios that were difficult or impossible to fully address before.
  585. - [#8700](https://github.com/biomejs/biome/pull/8700) [`0f5a05b`](https://github.com/biomejs/biome/commit/0f5a05b5f0b2cd526e7d524fe1311c1d46978e97) Thanks [@ematipico](https://github.com/ematipico)! - Improved the rules `useConst`, `noUnusedImports`, `useImportTypes` and `noUnusedVariables` inside
  586. Vue, Svelte and Astro files when `experimentalFullSupportEnabled` is set to `true`.
  587. Now variables and components that are imported or defined inside the files won't trigger false positives.
  588. Until now, we suggested disabling these rules with an override. _Now the rules are more stable_; however, you might still experience
  589. a few false positives. Those are probably issues caused by our parser.
  590. **If you use `experimentalFullSupportEnabled`, you can remove the following override:**
  591. ```diff
  592. {
  593. - "overrides": [
  594. - {
  595. - "includes": ["**/*.svelte", "**/*.astro", "**/*.vue"],
  596. - "linter": {
  597. - "rules": {
  598. - "style": {
  599. - "useConst": "off",
  600. - "useImportType": "off"
  601. - },
  602. - "correctness": {
  603. - "noUnusedVariables": "off",
  604. - "noUnusedImports": "off"
  605. - }
  606. - }
  607. - }
  608. - }
  609. - ]
  610. }
  611. ```
  612. - [#8485](https://github.com/biomejs/biome/pull/8485) [`bf02ba6`](https://github.com/biomejs/biome/commit/bf02ba652f9dc69bcd6010c6f57850b73fc33d49) Thanks [@ematipico](https://github.com/ematipico)! - Fixed an issue where some info diagnostics weren't tracked by the final summary.
  613. - [#8846](https://github.com/biomejs/biome/pull/8846) [`5701ead`](https://github.com/biomejs/biome/commit/5701ead5ba5964e5d6eeb4880688790a19d5e2d5) Thanks [@dyc3](https://github.com/dyc3)! - Fixed [#8692](https://github.com/biomejs/biome/issues/8692): Biome now accepts Vue's `v-bind()` function in CSS when Vue CSS modules parsing is enabled.
  614. - [#9012](https://github.com/biomejs/biome/pull/9012) [`18cdd45`](https://github.com/biomejs/biome/commit/18cdd455ca6707d357de6500853ec7f4fe602c8d) Thanks [@kiroushi](https://github.com/kiroushi)! - Fixed plugin diagnostics showing incorrect line numbers in Vue, Astro, and Svelte files. Plugin diagnostics now correctly account for the template/frontmatter offset, pointing to the right location in the `<script>` block.
  615. ## What's Changed
  616. * feat(lsp): report progress while scanning the project by @siketyan in https://github.com/biomejs/biome/pull/7961
  617. * feat(formatter/yaml): setup stub implementation by @siketyan in https://github.com/biomejs/biome/pull/8000
  618. * feat(biome_js_analyze): custom jsxFactory and jsxFragmentFactory by @Jagget in https://github.com/biomejs/biome/pull/7847
  619. * fix(lint): improve `useHookAtTopLevel` lint by @andogq in https://github.com/biomejs/biome/pull/7749
  620. * feat(core): watcher options by @ematipico in https://github.com/biomejs/biome/pull/8071
  621. * feat(js/useImportExtensions): add `extensionMappings` option by @dyc3 in https://github.com/biomejs/biome/pull/7762
  622. * feat: sort interface members by @ematipico in https://github.com/biomejs/biome/pull/8164
  623. * feat(lint/html): add `noAccessKey` by @lucasweng in https://github.com/biomejs/biome/pull/8165
  624. * feat(biome_html_analyze): add useButtonType rule (#8241) by @ashnewmanjones in https://github.com/biomejs/biome/pull/8243
  625. * feat(lint/html): add `useHtmlLang` by @lucasweng in https://github.com/biomejs/biome/pull/8262
  626. * feat(lint/html): implement noDistractingElements for html by @mehm8128 in https://github.com/biomejs/biome/pull/8287
  627. * feat(css): add support for the typed `attr` CSS function by @ryan-m-walker in https://github.com/biomejs/biome/pull/8255
  628. * feat(lsp): provide inline configuration by @ematipico in https://github.com/biomejs/biome/pull/8278
  629. * feat(lint/html): add `useIframeTitle` by @lucasweng in https://github.com/biomejs/biome/pull/8270
  630. * feat(css): update CSS properties order to align with stylelint-config-recess-order@7.4.0 by @ongyuxing in https://github.com/biomejs/biome/pull/8234
  631. * feat(lint/html): implement useValidAriaRole for html by @mehm8128 in https://github.com/biomejs/biome/pull/8307
  632. * test: fix recent failures on `next` by @dyc3 in https://github.com/biomejs/biome/pull/8388
  633. * feat(lint/html): implement useAriaPropsForRole for html by @mehm8128 in https://github.com/biomejs/biome/pull/8381
  634. * feat: support formatting embedded CSS in JS by @siketyan in https://github.com/biomejs/biome/pull/7973
  635. * feat(useSortedKeys): add groupByNesting option by @PaulRBerg in https://github.com/biomejs/biome/pull/7799
  636. * feat: support formatting GraphQL in JS by @siketyan in https://github.com/biomejs/biome/pull/8376
  637. * feat(html/noPositiveTabindex): port noPositiveTabindex rule to HTML by @tt-a1i in https://github.com/biomejs/biome/pull/8501
  638. * refactor(cli): make commands more generic by @ematipico in https://github.com/biomejs/biome/pull/8485
  639. * feat(html): support CSS modules syntax and vue css syntax by @ematipico in https://github.com/biomejs/biome/pull/8399
  640. * feat(lint/html): implement noSvgWithoutTitle for html by @mehm8128 in https://github.com/biomejs/biome/pull/8412
  641. * feat(lint): add options from `typescript-eslint` to `useUnifiedTypeSignature` by @Bertie690 in https://github.com/biomejs/biome/pull/8368
  642. * chore: merge main to next by @ematipico in https://github.com/biomejs/biome/pull/8585
  643. * chore: merges `main` into `next` by @ematipico in https://github.com/biomejs/biome/pull/8650
  644. * feat(cli): add SARIF reporter by @Netail in https://github.com/biomejs/biome/pull/8631
  645. * feat(cli): show backtrace on panic if available by @siketyan in https://github.com/biomejs/biome/pull/8647
  646. * feat(linter): add noAutofocus rule for HTML by @tt-a1i in https://github.com/biomejs/biome/pull/8641
  647. * feat: add the checkForEach option to useIterableCallbackReturn by @theshadow27 in https://github.com/biomejs/biome/pull/8289
  648. * feat(html): add `useAltText` a11y rule by @tt-a1i in https://github.com/biomejs/biome/pull/8661
  649. * fix(lint): fix useComponentExportOnlyModules false positive with TanStack Router by @tt-a1i in https://github.com/biomejs/biome/pull/8669
  650. * feat(lint): types domain and optional inference by @ematipico in https://github.com/biomejs/biome/pull/8564
  651. * feat(html): implement noRedundantAlt by @ematipico in https://github.com/biomejs/biome/pull/8666
  652. * feat(core): improved bindings detection by @ematipico in https://github.com/biomejs/biome/pull/8642
  653. * feat(core): hidden files and config dirs by @ematipico in https://github.com/biomejs/biome/pull/8663
  654. * feat(formatter): trailing newline by @ematipico in https://github.com/biomejs/biome/pull/8334
  655. * feat(formatter): top-level suppression by @ematipico in https://github.com/biomejs/biome/pull/8695
  656. * feat(cli): add --skip and --only to check and ci commands by @jonaylor89 in https://github.com/biomejs/biome/pull/8532
  657. * feat(html/analyze): add useValidLang by @ematipico in https://github.com/biomejs/biome/pull/8690
  658. * fix(lint): correctly track embedded bindings in rules by @ematipico in https://github.com/biomejs/biome/pull/8700
  659. * feat(html): directives parsing and formatting by @ematipico in https://github.com/biomejs/biome/pull/8719
  660. * feat(grit): add JSON GritQL support by @cbstns in https://github.com/biomejs/biome/pull/8723
  661. * feat: apply code fixes to embedded snippets in JS by @siketyan in https://github.com/biomejs/biome/pull/8662
  662. * feat(biome_html_analyze): add useMediaCaption rule for HTML by @rahuld109 in https://github.com/biomejs/biome/pull/8742
  663. * feat(biome_html_analyze): implement useAnchorContent rule for HTML by @rahuld109 in https://github.com/biomejs/biome/pull/8769
  664. * fix(lint): improve noSvgWithoutTitle so that it reports more invalid cases by @mehm8128 in https://github.com/biomejs/biome/pull/8556
  665. * refactor(format/html): overhaul HTML formatter by @dyc3 in https://github.com/biomejs/biome/pull/8806
  666. * chore: tweak changeset by @dyc3 in https://github.com/biomejs/biome/pull/8834
  667. * fix(format/html): break if >2 children, and at least one is not whitespace sensitive by @dyc3 in https://github.com/biomejs/biome/pull/8833
  668. * feat(css_analyze): add an ignore option to `noUnknownFunction`, `noUnknownProperty`, `noUnknownPseudoClass` & `noUnknownPseudoElement` by @Netail in https://github.com/biomejs/biome/pull/8814
  669. * feat(parser/markdown): parser implementation by @jfmcdowell in https://github.com/biomejs/biome/pull/8525
  670. * feat(parse/css): add support for vue's `v-bind()` function by @dyc3 in https://github.com/biomejs/biome/pull/8846
  671. * chore(coverage): move CommonMark conformance tests to xtask/coverage by @jfmcdowell in https://github.com/biomejs/biome/pull/8857
  672. * fix(biome_html_analyze): consolidate a11y helpers and fix aria-hidden behavior by @rahuld109 in https://github.com/biomejs/biome/pull/8837
  673. * feat(core): improve useImportTypes detection by @ematipico in https://github.com/biomejs/biome/pull/8824
  674. * fix(core): workspace formatting by @ematipico in https://github.com/biomejs/biome/pull/8854
  675. * feat(cli): rule profiler by @dyc3 in https://github.com/biomejs/biome/pull/8562
  676. * refactor(html): component parsing by @ematipico in https://github.com/biomejs/biome/pull/8886
  677. * feat(css): add support for the `@function` CSS at rule by @ryan-m-walker in https://github.com/biomejs/biome/pull/8839
  678. * feat(html): improved parsing spread attributes by @ematipico in https://github.com/biomejs/biome/pull/8894
  679. * feat(linter): add e18e rules by @ematipico in https://github.com/biomejs/biome/pull/8898
  680. * feat(cli): multi reporters by @Netail in https://github.com/biomejs/biome/pull/8621
  681. * feat(useHookAtTopLevel): add `ignore` option by @dyc3 in https://github.com/biomejs/biome/pull/8964
  682. * fix(core): improve bindings detection by @ematipico in https://github.com/biomejs/biome/pull/8918
  683. * fix(markdown): improve CommonMark conformance and parser structure by @jfmcdowell in https://github.com/biomejs/biome/pull/8908
  684. * feat(assist): add noDuplicateClasses assist action by @mldangelo in https://github.com/biomejs/biome/pull/8623
  685. * refactor(useButtonType): simplify and some related docs by @dyc3 in https://github.com/biomejs/biome/pull/8994
  686. * fix(core): snippets ts by @ematipico in https://github.com/biomejs/biome/pull/8991
  687. * feat(formatter): set up boiletplate for markdown formatter by @tidefield in https://github.com/biomejs/biome/pull/8962
  688. * feat(scss): add basic SCSS declaration support and comments by @denbezrukov in https://github.com/biomejs/biome/pull/8721
  689. * fix(html): parsing of directives in svelte by @ematipico in https://github.com/biomejs/biome/pull/9021
  690. * docs(lint): useNamingConvention - object/type member by @zbycz in https://github.com/biomejs/biome/pull/9010
  691. * fix(lsp): apply diagnostic offset for plugin diagnostics in Vue/Astro/Svelte files by @kiroushi in https://github.com/biomejs/biome/pull/9012
  692. * chore: agents overhaul by @ematipico in https://github.com/biomejs/biome/pull/9044
  693. * fix(lint): allow hr with role="presentation" by @LouisLau-art in https://github.com/biomejs/biome/pull/9028
  694. * fix(useButtonType): better default behavior in Vue and Svelte by @dyc3 in https://github.com/biomejs/biome/pull/8995
  695. * fix(service): don't duplicate snippet's trivia when updating snippets by @dyc3 in https://github.com/biomejs/biome/pull/9051
  696. * fix: merge main to next by @ematipico in https://github.com/biomejs/biome/pull/9054
  697. * fix(analyze): apply diagnostic offsets to raw diagnostics as well as rule diagnostics by @dyc3 in https://github.com/biomejs/biome/pull/9060
  698. * fix(core): tracking vue bindings inside directives by @ematipico in https://github.com/biomejs/biome/pull/9053
  699. * fix(core): custom lsp configuration by @ematipico in https://github.com/biomejs/biome/pull/9049
  700. * feat: promote rules for v2.4 by @ematipico in https://github.com/biomejs/biome/pull/9011
  701. * fix(service): include embedded bindings and value reference services when applying suppressions by @dyc3 in https://github.com/biomejs/biome/pull/9059
  702. * chore: biome v2.4 by @dyc3 in https://github.com/biomejs/biome/pull/8275
  703. * fix(noCommaOperator): disable rule in vue template expressions by @dyc3 in https://github.com/biomejs/biome/pull/9074
  704. * fix(noVueDuplicateKeys): fix false positives with `toRefs` patterns by @dyc3 in https://github.com/biomejs/biome/pull/9072
  705. * ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/9045
  706. ## New Contributors
  707. * @Jagget made their first contribution in https://github.com/biomejs/biome/pull/7847
  708. * @andogq made their first contribution in https://github.com/biomejs/biome/pull/7749
  709. * @PaulRBerg made their first contribution in https://github.com/biomejs/biome/pull/7799
  710. * @theshadow27 made their first contribution in https://github.com/biomejs/biome/pull/8289
  711. * @jonaylor89 made their first contribution in https://github.com/biomejs/biome/pull/8532
  712. * @cbstns made their first contribution in https://github.com/biomejs/biome/pull/8723
  713. * @rahuld109 made their first contribution in https://github.com/biomejs/biome/pull/8742
  714. * @kiroushi made their first contribution in https://github.com/biomejs/biome/pull/9012
  715. **Full Changelog**: https://github.com/biomejs/biome/compare/@biomejs/biome@2.3.15...@biomejs/biome@2.4.0

auf github ansehenimported 2026-09-28 über npm