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