@biomejs/js-api@6.0.0
zaidmukaddam/scira@biomejs/js-api@6.0.0Jun 12, 2026by github-actions[bot]
AI Summary
Introduces a helper function to convert byte-based spans to UTF-16 code units for accurate text extraction and updates dependencies to 2.5.0.
Key Highlights
- New spanInBytesToSpanInCodeUnits helper function for correct text extraction
- Fixes text extraction issues with non-ASCII content
- Updates dependencies to @biomejs/wasm-web@2.5.0
New Features
- Added spanInBytesToSpanInCodeUnits helper function
- Support for SCSS qualified names in values and function calls
- Support for SCSS nesting declarations in declaration lists
- Support for delimiters in bracketed value lists
- Added sortBareImports option in organizeImports
- Added delimiterSpacing option for formatters
- Added watch mode (--watch) to the CLI
Full Release Notes
## 6.0.0
### Minor Changes
- [#8944](https://github.com/biomejs/biome/pull/8944) [`8cd3da1`](https://github.com/biomejs/biome/commit/8cd3da1c9008109a17264ea60d1022a8373d3265) Thanks [@ash1day](https://github.com/ash1day)! - Added a new `spanInBytesToSpanInCodeUnits` helper function to convert byte-based spans from Biome diagnostics to UTF-16 code unit spans.
Biome internally uses UTF-8 byte offsets for spans, but JavaScript strings use UTF-16 code units. This causes incorrect text extraction when using `string.slice()` with non-ASCII content. The new helper function correctly handles this conversion, including surrogate pairs and unpaired surrogates.
```js
import { spanInBytesToSpanInCodeUnits } from "@biomejs/js-api";
const [start, end] = spanInBytesToSpanInCodeUnits(
diagnostic.location.span,
content,
);
const text = content.slice(start, end); // Correctly extracts the text
```
### Patch Changes
- Updated dependencies []:
- @biomejs/wasm-web@2.5.0
- @biomejs/wasm-bundler@2.5.0
- @biomejs/wasm-nodejs@2.5.0
## What's Changed
* feat(css): support SCSS qualified names in values and function calls by @denbezrukov in https://github.com/biomejs/biome/pull/9096
* feat(css): add unary expression parsing by @denbezrukov in https://github.com/biomejs/biome/pull/9093
* feat(css): support scss nesting declarations in declaration lists by @denbezrukov in https://github.com/biomejs/biome/pull/9135
* feat(css): allow scss declarations in @page blocks by @denbezrukov in https://github.com/biomejs/biome/pull/9139
* feat(css): allow delimiters in bracketed value lists by @denbezrukov in https://github.com/biomejs/biome/pull/9145
* feat(analyze/json): useSortedPackageJson by @ematipico in https://github.com/biomejs/biome/pull/9134
* feat: two new cross language rules by @ematipico in https://github.com/biomejs/biome/pull/9152
* feat(js-api): add spanInBytesToSpanInCodeUnits helper function by @ash1day in https://github.com/biomejs/biome/pull/8944
* feat: collect local and global styles for `noUndeclearedClasses` by @ematipico in https://github.com/biomejs/biome/pull/9297
* feat(organizeImports): add `sortBareImports` option by @Conaclos in https://github.com/biomejs/biome/pull/9384
* chore: merge main to next by @ematipico in https://github.com/biomejs/biome/pull/9443
* feat(linter): add includes option for plugin file scoping by @chocky335 in https://github.com/biomejs/biome/pull/9171
* feat(cli): add ANSI art Biome logo by @ematipico in https://github.com/biomejs/biome/pull/9533
* feat(biome_service): support applying GritQL plugin rewrites via --write by @chocky335 in https://github.com/biomejs/biome/pull/9073
* feat(lint): add ignore option to no-unused-variables by @mvarendorff in https://github.com/biomejs/biome/pull/9397
* feat(biome_html_analyze): port noRedundantRoles a11y rule to HTML in https://github.com/biomejs/biome/pull/9564
* revert: feat(biome_html_analyze): port noRedundantRoles a11y rule to HTML by @dyc3 in https://github.com/biomejs/biome/pull/9587
* feat(html/a11y): add noRedundantRoles rule for HTML by @IxxyDev in https://github.com/biomejs/biome/pull/9276
* feat(cli): concise reporter by @ematipico in https://github.com/biomejs/biome/pull/9539
* feat(biome_html_analyze): port useKeyWithMouseEvents a11y rule to HTML by @rahuld109 in https://github.com/biomejs/biome/pull/9582
* chore: fix `next` failures by @dyc3 in https://github.com/biomejs/biome/pull/9633
* feat(biome_html_analyze): port useAriaActivedescendantWithTabindex to HTML by @faizkhairi in https://github.com/biomejs/biome/pull/9617
* feat(lint): port useValidAnchor to html by @DerTimonius in https://github.com/biomejs/biome/pull/8987
* feat: improve noUndeclaredClasses by @ematipico in https://github.com/biomejs/biome/pull/9503
* feat(biome_html_analyze): port useHeadingContent a11y rule to HTML by @faizkhairi in https://github.com/biomejs/biome/pull/9716
* feat(formatter): add delimiterSpacing option by @luisherranz in https://github.com/biomejs/biome/pull/9718
* feat(assist): implement useSortedAttributes for HTML by @mujpao in https://github.com/biomejs/biome/pull/9547
* feat(html/a11y): port noAriaUnsupportedElements to HTML by @IxxyDev in https://github.com/biomejs/biome/pull/9491
* feat(assist): use sorted type fields 9137 by @ff1451 in https://github.com/biomejs/biome/pull/9275
* feat(html_analyze): port useValidAriaProps rule to HTML by @Maximiliano-Zeballos in https://github.com/biomejs/biome/pull/9761
* feat(html): port noAriaHiddenOnFocusable a11y rule to HTML by @aviraldua93 in https://github.com/biomejs/biome/pull/9496
* docs: remove duplicate sentence by @Netail in https://github.com/biomejs/biome/pull/9832
* fix: assist generator by @Netail in https://github.com/biomejs/biome/pull/9831
* feat(cli): add watch mode (--watch) to the CLI for check/format/lint commands by @siketyan in https://github.com/biomejs/biome/pull/8731
* refactor: improve watch mode by @ematipico in https://github.com/biomejs/biome/pull/9859
* feat(cli): add `upgrade` command by @nhedger in https://github.com/biomejs/biome/pull/9546
* chore: extra rule sources by @Netail in https://github.com/biomejs/biome/pull/9872
* feat(graphql_analyze): implement useSortedSelectionSet by @Netail in https://github.com/biomejs/biome/pull/9853
* feat(html): port useValidAriaValues a11y rule to HTML by @aviraldua93 in https://github.com/biomejs/biome/pull/9928
* chore: merge `main` into `next` by @dyc3 in https://github.com/biomejs/biome/pull/9945
* feat(lint/html): port noExcessiveLinesPerFile to html by @dyc3 in https://github.com/biomejs/biome/pull/9967
* docs(organizeImports): revamp user-facing docs by @Conaclos in https://github.com/biomejs/biome/pull/9887
* ci: update snapshots by @Conaclos in https://github.com/biomejs/biome/pull/9986
* chore: abstract html tag matcher (main into next) by @Netail in https://github.com/biomejs/biome/pull/9993
* feat(linter): add noNonInteractiveTabIndex for HTML by @viraxslot in https://github.com/biomejs/biome/pull/9306
* feat(html_analyze): implement noNoninteractiveElementToInteractiveRole by @Netail in https://github.com/biomejs/biome/pull/10022
* feat(html_analyze): implement noInteractiveElementToNoninteractiveRole by @Netail in https://github.com/biomejs/biome/pull/10028
* feat(html_analyze): implement useValidAutocomplete by @Netail in https://github.com/biomejs/biome/pull/10013
* feat(html_analyze): implement noNoninteractiveElementInteractions by @Netail in https://github.com/biomejs/biome/pull/10026
* feat(js-formatter): implement delimiterSpacing for JavaScript by @luisherranz in https://github.com/biomejs/biome/pull/9719
* fix: next branch ci (+ main into next) by @Netail in https://github.com/biomejs/biome/pull/10051
* feat(html_analyze): implement useAriaPropsSupportedByRole by @Netail in https://github.com/biomejs/biome/pull/10015
* feat(linter): preset by @ematipico in https://github.com/biomejs/biome/pull/9813
* feat(organizeImports): add :STYLE: group matcher by @Conaclos in https://github.com/biomejs/biome/pull/10070
* feat(lint): support pnpm catalogs by @apple-yagi in https://github.com/biomejs/biome/pull/8396
* feat(html_analyze): implement useFocusableInteractive by @Netail in https://github.com/biomejs/biome/pull/10067
* feat(html): port useKeyWithClickEvents a11y rule to HTML by @aviraldua93 in https://github.com/biomejs/biome/pull/9495
* feat(html_analyze): port useSemanticElements a11y rule to HTML by @Maximiliano-Zeballos in https://github.com/biomejs/biome/pull/9792
* feat(js-formatter): implement delimiterSpacing for JSX by @luisherranz in https://github.com/biomejs/biome/pull/9720
* feat(js-formatter): implement delimiterSpacing for TypeScript by @luisherranz in https://github.com/biomejs/biome/pull/9721
* feat(json-formatter): implement delimiterSpacing for JSON by @luisherranz in https://github.com/biomejs/biome/pull/9723
* feat(html_analyze): port noLabelWithoutControl by @Netail in https://github.com/biomejs/biome/pull/10089
* chore: merge main into next by @Netail in https://github.com/biomejs/biome/pull/10104
* feat(migrate): map ESLint spacing rules to delimiterSpacing by @luisherranz in https://github.com/biomejs/biome/pull/9724
* feat(css-formatter): implement delimiterSpacing for CSS by @luisherranz in https://github.com/biomejs/biome/pull/9722
* feat(biome_js_analyze): add `bundleDependencies` option to `NoUndeclaredDependencies` rule by @mdrobny in https://github.com/biomejs/biome/pull/9170
* fix: workspace generation by @Netail in https://github.com/biomejs/biome/pull/10107
* feat(html_analyze): implement noStaticElementInteractions by @Netail in https://github.com/biomejs/biome/pull/10069
* feat: implement useSortedEnumMembers by @Netail in https://github.com/biomejs/biome/pull/10000
* feat(organizeImports): add `kind` field to import matcher by @georgephillips in https://github.com/biomejs/biome/pull/10074
* chore: main into next by @Netail in https://github.com/biomejs/biome/pull/10142
* chore: changeset corrections by @Netail in https://github.com/biomejs/biome/pull/10145
* fix: align HTML & JS a11y sources by @Netail in https://github.com/biomejs/biome/pull/10120
* feat(lint): add rule options for `noImplicitCoercions` to ignore double negations by @Bertie690 in https://github.com/biomejs/biome/pull/9309
* docs: incorrect markdown by @ematipico in https://github.com/biomejs/biome/pull/10186
* feat(core): handle svg files by @ematipico in https://github.com/biomejs/biome/pull/10106
* feat(config): expose `html.parser.vue` by @dyc3 in https://github.com/biomejs/biome/pull/9366
* chore: refactor delimiterSpacing changesets by @ematipico in https://github.com/biomejs/biome/pull/10234
* perf(core): cache analyzer visitor by @ematipico in https://github.com/biomejs/biome/pull/10204
* feat: go-to definition (#9619) by @ematipico in https://github.com/biomejs/biome/pull/9700
* chore: merge main into next by @ematipico in https://github.com/biomejs/biome/pull/10316
* feat(core): respect git info exclude files by @jongwan56 in https://github.com/biomejs/biome/pull/10121
* feat(useNumericSeparators): add options for minimum digits and group length by @dyc3 in https://github.com/biomejs/biome/pull/9571
* chore: merge into next by @ematipico in https://github.com/biomejs/biome/pull/10435
* refactor: use salsa by @ematipico in https://github.com/biomejs/biome/pull/10315
* chore: merge main into next by @ematipico in https://github.com/biomejs/biome/pull/10453
* chore: enable unstable features on preview builds for playground by @siketyan in https://github.com/biomejs/biome/pull/10485
* ci: enable automation jobs by @ematipico in https://github.com/biomejs/biome/pull/10443
* feat(lint): add ignoreMixedLogicalExpressions option to useNullishCoa… by @pkallos in https://github.com/biomejs/biome/pull/9974
* fix(parser/yaml): correctly lex anchor/tag properties followed by a sequence by @siketyan in https://github.com/biomejs/biome/pull/10481
* fix(markdown_parser): keep loose list across empty item before blank line by @jfmcdowell in https://github.com/biomejs/biome/pull/10483
* fix(lint/noUnnecessaryConditions): extend detection coverage by @IxxyDev in https://github.com/biomejs/biome/pull/10108
* chore: merge main into next by @ematipico in https://github.com/biomejs/biome/pull/10500
* fix(html-parser): allow omitting binding in Svelte {:then} and {:catch} blocks by @Mokto in https://github.com/biomejs/biome/pull/10487
* ci: correct token for removing label by @ematipico in https://github.com/biomejs/biome/pull/10511
* fix(css_parser): parse semicolonless scss rules by @denbezrukov in https://github.com/biomejs/biome/pull/10509
* chore(deps): update rust crate jiff to 0.2.28 by @renovate[bot] in https://github.com/biomejs/biome/pull/10521
* chore(deps): update rust crate serde_json to 1.0.150 by @renovate[bot] in https://github.com/biomejs/biome/pull/10522
* chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/10524
* chore(deps): update pnpm to v11.4.0 by @renovate[bot] in https://github.com/biomejs/biome/pull/10525
* ci: remove cli benchmark by @ematipico in https://github.com/biomejs/biome/pull/10526
* fix(css_parser): support interpolated dashed identifiers in function at-rules by @denbezrukov in https://github.com/biomejs/biome/pull/10518
* fix(parser/yaml): lex DIRECTIVE_END in stream by @siketyan in https://github.com/biomejs/biome/pull/10480
* fix(parser/yaml): lex directives by @siketyan in https://github.com/biomejs/biome/pull/10484
* fix(parse/js/vue): allow v-on directives with multiple inline statements by @dyc3 in https://github.com/biomejs/biome/pull/10520
* feat(core): implement YAML file handler by @siketyan in https://github.com/biomejs/biome/pull/10527
* fix(useImportType): always separate types from default named imports by @Conaclos in https://github.com/biomejs/biome/pull/10530
* fix(css_formatter): preserve declaration comment boundaries by @denbezrukov in https://github.com/biomejs/biome/pull/10532
* feat(formatter/yaml): initial implementation for simple block mappings by @siketyan in https://github.com/biomejs/biome/pull/10528
* feat(formatter/yaml): initial implementation for block sequences by @siketyan in https://github.com/biomejs/biome/pull/10529
* feat(tailwind_parser): parse Tailwind variant expressions by @jiwon79 in https://github.com/biomejs/biome/pull/10448
* chore(deps): update github-actions (major) by @renovate[bot] in https://github.com/biomejs/biome/pull/10538
* fix(svelte_parser): support destructuring rename bindings in {#each} blocks by @Mokto in https://github.com/biomejs/biome/pull/10491
* perf: reduce allocations in noExcessiveLinesPerFile rules by @ematipico in https://github.com/biomejs/biome/pull/10506
* feat(html/nursery): add useSvelteRequireEachKey rule by @Mokto in https://github.com/biomejs/biome/pull/10503
* fix(diagnostics): truncate diagnostics that are super long to keep output readable by @dyc3 in https://github.com/biomejs/biome/pull/10539
* feat(lint/useIterableCallbackReturn): add allowImplicit option #9445 by @TXWSLYF in https://github.com/biomejs/biome/pull/10461
* fix(css-parser): allow comma-separated selector lists inside :global() and :local() by @Mokto in https://github.com/biomejs/biome/pull/10490
* fix(linter): recognize contrast-color() as a known CSS function by @tim-we in https://github.com/biomejs/biome/pull/10546
* fix(parse/html): don't bother tracking unicode escape sequences by @dyc3 in https://github.com/biomejs/biome/pull/10542
* fix(cli): emit rdjson code suggestion replacements by @mangod12 in https://github.com/biomejs/biome/pull/10543
* refactor(organizeImports): require `sortBareImports` for bare matchers by @Conaclos in https://github.com/biomejs/biome/pull/10517
* feat(linter): implement useIncludes rule by @Dotify71 in https://github.com/biomejs/biome/pull/10516
* fix(html-parser): allow TypeScript as const in Svelte {#each} expressions by @Mokto in https://github.com/biomejs/biome/pull/10489
* chore: add SCSS in unstable wasm build by @denbezrukov in https://github.com/biomejs/biome/pull/10551
* test(css_formatter): sync Prettier CSS and SCSS fixtures by @denbezrukov in https://github.com/biomejs/biome/pull/10554
* chore: merge main into next by @ematipico in https://github.com/biomejs/biome/pull/10553
* chore: biome v2.5 by @ematipico in https://github.com/biomejs/biome/pull/9277
* fix: avoid infinite recursion by passing depth to resolve_callee_to_function by @ematipico in https://github.com/biomejs/biome/pull/10556
* fix(css_formatter): add spacing SCSS binary expressions by @denbezrukov in https://github.com/biomejs/biome/pull/10537
* feat: noRestrictedDependencies by @Netail in https://github.com/biomejs/biome/pull/10467
* feat: rule promotion for v2.5 by @ematipico in https://github.com/biomejs/biome/pull/10562
* fix(useVueConsistentVBindStyle): don't flag v-bind directives that don't have arguments by @dyc3 in https://github.com/biomejs/biome/pull/10565
* fix(useVueHyphenatedAttributes): only run in vue files, exclude svgs and their children by @dyc3 in https://github.com/biomejs/biome/pull/10566
* docs: replace "allows to" with "allows you to" in formatter comments by @dfedoryshchev in https://github.com/biomejs/biome/pull/10507
* feat(useExportType): add style option by @Conaclos in https://github.com/biomejs/biome/pull/10561
* refactor(useExportType): improve docs and code by @Conaclos in https://github.com/biomejs/biome/pull/10569
* refactor(noTsIgnore): avoid one alloc, improve range reporting by @Conaclos in https://github.com/biomejs/biome/pull/10570
* fix(css_parser): parse SCSS bracketed expression lists by @denbezrukov in https://github.com/biomejs/biome/pull/10567
* fix(a11y): useAriaPropsForRole no longer false-positives on Vue v-bind shorthand 🤖🤖🤖 by @harsha-cpp in https://github.com/biomejs/biome/pull/10568
* fix(css_formatter): indent broken SCSS string concatenation by @denbezrukov in https://github.com/biomejs/biome/pull/10571
* fix(css_formatter): preserve SCSS grid template rows by @denbezrukov in https://github.com/biomejs/biome/pull/10572
* feat(css_parser): parse interpolated scss media conditions by @denbezrukov in https://github.com/biomejs/biome/pull/10573
* feat(css_formatter): expand compound SCSS variable lists by @denbezrukov in https://github.com/biomejs/biome/pull/10577
* fix: docs and readme by @ematipico in https://github.com/biomejs/biome/pull/10584
* feat(css): parse dynamic SCSS keyframes names by @denbezrukov in https://github.com/biomejs/biome/pull/10587
* fix(markdown): remove unused hard_line slot from MdParagraph by @jfmcdowell in https://github.com/biomejs/biome/pull/10593
* feat(css_parser): parse SCSS variables in keyframes by @denbezrukov in https://github.com/biomejs/biome/pull/10598
* feat(css_formatter): improve SCSS variable declaration formatting by @denbezrukov in https://github.com/biomejs/biome/pull/10597
* chore(deps): update dependency @types/node to v24.13.1 by @renovate[bot] in https://github.com/biomejs/biome/pull/10579
* chore(deps): update github-actions by @renovate[bot] in https://github.com/biomejs/biome/pull/10580
* chore(deps): update rust to v1.96.0 by @renovate[bot] in https://github.com/biomejs/biome/pull/10582
* chore(deps): update pnpm to v11.5.2 by @renovate[bot] in https://github.com/biomejs/biome/pull/10581
* test(md): cover loose list + mixed space-tab sublist in fuzz corpus by @jfmcdowell in https://github.com/biomejs/biome/pull/10594
* feat(css_formatter): keep SCSS scalar parentheses inline by @denbezrukov in https://github.com/biomejs/biome/pull/10599
* fix(markdown): remove dead syntax kinds and fix bogus node handling by @jfmcdowell in https://github.com/biomejs/biome/pull/10600
* fix(markdown): reset link-definition continuation when a block quote opens by @jfmcdowell in https://github.com/biomejs/biome/pull/10601
* fix(css_parser): parse comma-separated composes values by @xsourabhsharma in https://github.com/biomejs/biome/pull/10591
* fix(biome_configuration): avoid Markdown links in JSON schema descriptions by @mvanhorn in https://github.com/biomejs/biome/pull/10589
* fix(lint): detect imported process env usage by @ShaharAviram1 in https://github.com/biomejs/biome/pull/10470
* feat(fmt/md): improve formatting of list against prettier by @ematipico in https://github.com/biomejs/biome/pull/10383
* feat(html_parser): parse Svelte interpolations in quoted attribute values by @Mokto in https://github.com/biomejs/biome/pull/10555
* refactor: removes mutex from salsa db by @ematipico in https://github.com/biomejs/biome/pull/10608
* feat(css_parser): parse interpolated SCSS supports conditions by @denbezrukov in https://github.com/biomejs/biome/pull/10602
* fix(css_formatter): align grid-template-areas rows after comments by @denbezrukov in https://github.com/biomejs/biome/pull/10603
* refactor(formatter): introduce the SourcePosition element and remove source position from Text and LocatedTokenText variant by @denbezrukov in https://github.com/biomejs/biome/pull/8012
* feat(lint): add useFunctionComponentDefinition rule by @citadelgrad in https://github.com/biomejs/biome/pull/10498
* ci: release by @github-actions[bot] in https://github.com/biomejs/biome/pull/10499
## New Contributors
* @ash1day made their first contribution in https://github.com/biomejs/biome/pull/8944
* @mvarendorff made their first contribution in https://github.com/biomejs/biome/pull/9397
* @IxxyDev made their first contribution in https://github.com/biomejs/biome/pull/9276
* @faizkhairi made their first contribution in https://github.com/biomejs/biome/pull/9617
* @luisherranz made their first contribution in https://github.com/biomejs/biome/pull/9718
* @Maximiliano-Zeballos made their first contribution in https://github.com/biomejs/biome/pull/9761
* @aviraldua93 made their first contribution in https://github.com/biomejs/biome/pull/9496
* @apple-yagi made their first contribution in https://github.com/biomejs/biome/pull/8396
* @mdrobny made their first contribution in https://github.com/biomejs/biome/pull/9170
* @georgephillips made their first contribution in https://github.com/biomejs/biome/pull/10074
* @jongwan56 made their first contribution in https://github.com/biomejs/biome/pull/10121
* @Mokto made their first contribution in https://github.com/biomejs/biome/pull/10487
* @TXWSLYF made their first contribution in https://github.com/biomejs/biome/pull/10461
* @mangod12 made their first contribution in https://github.com/biomejs/biome/pull/10543
* @harsha-cpp made their first contribution in https://github.com/biomejs/biome/pull/10568
* @xsourabhsharma made their first contribution in https://github.com/biomejs/biome/pull/10591
* @ShaharAviram1 made their first contribution in https://github.com/biomejs/biome/pull/10470
* @citadelgrad made their first contribution in https://github.com/biomejs/biome/pull/10498
**Full Changelog**: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.16...@biomejs/js-api@6.0.0