2.4.15
Patch Changes
-
#9394
ba3480eThanks @dyc3! - Added the nursery ruleuseTestHooksInOrderin thetestdomain. The rule enforces that Jest/Vitest lifecycle hooks (beforeAll,beforeEach,afterEach,afterAll) are declared in the order they execute, making test setup and teardown easier to reason about. -
#10254
e0a54ccThanks @dyc3! - Added a new nursery ruleuseVueNextTickPromise, which enforces Promise syntax when using VuenextTick.For example, the following snippet triggers the rule:
import { nextTick } from "vue"; nextTick(() => { updateDom(); });
-
#10219
64aee45Thanks @dyc3! - Added a new nursery rulenoVueVOnNumberValues, that disallows deprecated number modifiers on Vuev-ondirectives.For example, the following snippet triggers the rule:
<input @keyup.13="submit" />
-
#10195
7b8d4e1Thanks @dyc3! - Added the new nursery ruleuseVueValidVFor, which validates Vuev-fordirectives and reports invalid aliases, missing component keys, and keys that do not use iteration variables. -
#10238
1110256Thanks @dyc3! - Added the recommended nursery rulenoVueImportCompilerMacros, which disallows importing Vue compiler macros such asdefinePropsfromvuebecause they are automatically available. -
#10201
1a08f89Thanks @realknove! - Fixed #10193:style/useReadonlyClassPropertiesno longer reports class properties as readonly-able when they are assigned inside arrow callbacks nested in class property initializers. -
#9574
3bd2b6aThanks @Conaclos! - Fixed #9530. The diagnostics oforganizeImportsare now more detailed and more precise. They are also better at localizing where the issue is. -
#10205
a704a6cThanks @Conaclos! - Fixed #10185. `organizeImports now errors when it encounters an unknown predefined group.The following configuration is now reported as invalid because
:INEXISTENT:is an unknown predefined group.{ "assist": { "actions": { "source": { "organizeImports": { "options": { "groups": [":INEXISTENT:"] } } } } } } -
#10052
b565bedThanks @minseong0324! - ImprovednoMisleadingReturnType: it now flags union annotations whose extra variants are never returned, and suggests the narrower type (e.g.string | null→string).These functions are now reported because
nullandnumberare included in the return annotations but never returned:function getUser(): string | null { return "hello"; } // null is never returned function getCode(): string | number { return "hello"; } // number is never returned
-
#10213
ac30057Thanks @dyc3! - Fixed #9450: HTML and Vue element formatting now preserves child line breaks when an element contains another element child on its own line, instead of collapsing the child element onto the same line. -
#10275
9ee6c03Thanks @solithcy! - Fixed #10274: Svelte templates with missing expressions no longer parsed asHtmlBogusElement -
#10143
56798a7Thanks @minseong0324! -noMisleadingReturnTypenow detects misleading return type annotations when object literal properties are initialized withas const.This function is now reported because the return annotation widens a property initialized with
as const:function f(): { value: string } { return { value: "text" as const }; }
-
#10143
56798a7Thanks @minseong0324! -noUselessTypeConversionnow detects redundant conversions on object literal properties initialized withas const.This conversion is now reported because
message.valueis inferred as a string literal:const message = { value: "text" as const }; String(message.value);
-
#9807
0ae5840Thanks @dyc3! - Added the new nursery ruleuseThisInClassMethods, based on ESLint'sclass-methods-use-this.The rule now reports instance methods, getters, setters, and function-valued instance fields that do not use
this, andbiome migrate eslintpreserves the supportedignoreMethods,ignoreOverrideMethods, andignoreClassesWithImplementsoptions.Invalid:
class Foo { bar() { // does not use `this`, invalid console.log("Hello Biome"); } }
-
#10258
e7b18f7Thanks @ematipico! - Improved linter performance by narrowing the query nodes for several lint rules, reducing how often they are evaluated. -
#10273
04e22a1Thanks @dyc3! - Fixed #10271: The HTML parser now correctly parsesofas text content when in text contexts. -
#9838
83f7385Thanks @dyc3! - Added the nursery rulenoBaseToString, which reports stringification sites that fall back to Object's default"[object Object]"formatting. The rule also supports theignoredTypeNamesoption. -
#10143
56798a7Thanks @minseong0324! -useExhaustiveSwitchCasesnow checks switch statements over object literal properties initialized withas const.This switch is now reported because
status.kindis inferred as the string literal"ready"but no case handles it:const status = { kind: "ready" as const }; switch (status.kind) { }
-
#10143
56798a7Thanks @minseong0324! -useStringStartsEndsWithnow detects string index comparisons on object literal properties initialized withas const.This comparison is now reported because
message.valueis inferred as a string literal:const message = { value: "hello" as const }; message.value[0] === "h";
What's Changed
- fix(markdown_parser): parse indented reference continuation by @jfmcdowell in #10192
- fix(markdown_parser): parse quoted ordered list interrupts by @jfmcdowell in #10194
- docs: fix typo in CONTRIBUTING ("the these" -> "these") by @dfedoryshchev in #10203
- feat(css_formatter): improve SCSS
@eachrule formatting by @denbezrukov in #10202 - test(markdown_parser): cover quoted ordered sublist by @jfmcdowell in #10197
- fix(markdown_parser): keep loose lazy continuation by @jfmcdowell in #10198
- fix(organizeImports): error on unknown predefined groups by @Conaclos in #10205
- feat(css_formatter): improve SCSS map formatting for parenthesized list keys by @denbezrukov in #10207
- feat(css_parser): parse scss interpolated nth arguments by @denbezrukov in #10209
- fix(format/html): preserve multiline element-only children by @dyc3 in #10213
- test(css_parser): cover SCSS interpolated operator operands by @denbezrukov in #10214
- fix: collect readonly class property arrow writes by @realknove in #10201
- fix(css_parser): parse spaced SCSS function heads by context by @denbezrukov in #10215
- feat(css_formatter): improve SCSS map value and pair formatting for better readability by @denbezrukov in #10216
- feat(css_formatter): enhance SCSS map value formatting by @denbezrukov in #10217
- feat(css_formatter): improve formatting for parenthesized SCSS lists by @denbezrukov in #10218
- fix(markdown_parser): keep empty reference paragraph by @jfmcdowell in #10199
- fix(markdown_parser): diagnose backtick in fence info string by @jfmcdowell in #10224
- chore(deps): update rust crate insta to 1.47.2 by @renovate[bot] in #10233
- chore(deps): update pnpm to v10.33.2 by @renovate[bot] in #10231
- chore(deps): update github-actions by @renovate[bot] in #10230
- chore(deps): update dependency tombi to v0.10.1 by @renovate[bot] in #10227
- chore(deps): update rust crate indexmap to 2.14.0 by @renovate[bot] in #10232
- chore(deps): update rust docker tag to v1.95.0 by @renovate[bot] in #10225
- feat(yaml_parser): lex YAML properties by @l0ngvh in #9471
- feat(type-info): preserve object-literal as const properties by @minseong0324 in #10143
- fix: fmt and clippy by @ematipico in #10235
- feat(lint/html/vue): add
noVueVOnNumberValuesby @dyc3 in #10219 - feat(lint/js): add
noBaseToStringby @dyc3 in #9838 - fix(markdown_parser): preserve lazy emphasis and quoted thematic breaks by @jfmcdowell in #10228
- feat(fmt/md): headers spacing by @ematipico in #10250
- fix(lint): fix false negative in noMisleadingReturnType for union annotations by @minseong0324 in #10052
- feat(fmt/md): proper word filling by @ematipico in #10252
- feat(lint/js): add
useThisForClassMethodsby @dyc3 in #9807 - feat(css_formatter): improve SCSS
@ifand@else ifformatting by @denbezrukov in #10253 - refactor(organizeImports): improve diagnostics by @Conaclos in #9574
- refactor(markdown_parser): name CommonMark magic numbers by @jfmcdowell in #10264
- fix: grammar in extends docstring by @Netail in #10263
- feat(css_formatter): improve formatting for SCSS parenthesized expressions and include arguments by @denbezrukov in #10269
- test(markdown_parser): promote html-only regression cases to .md fixtures by @jfmcdowell in #10255
- fix: svelte missing expression parsing by @solithcy in #10275
- fix(parse/html): treat
ofas text in text contexts by @dyc3 in #10273 - chore: update rustix transient dep to fix ci by @dyc3 in #10279
- feat(lint/vue): add
noVueImportCompilerMacrosby @dyc3 in #10238 - feat(css_formatter): improve SCSS map formatting by @denbezrukov in #10282
- feat(css_formatter): improve formatting SCSS function arguments with trailing commas by @denbezrukov in #10285
- feat(lint/js/vue): add
useVueNextTickPromiseby @dyc3 in #10254 - feat(yaml_parser): parse YAML properties by @l0ngvh in #10240
- feat(lint/js): add
useTestHooksInOrderby @dyc3 in #9394 - perf: reduced queries in rules by @ematipico in #10258
- fix(formatter): flush indentation after align end by @ematipico in #10293
- test(formatter/yaml): populate Prettier tests for YAML by @siketyan in #8330
- fix(fmt/md): remove trailing spaces in markdown lists by @ematipico in #10290
- feat(css_parser): support SCSS string concatenation and improved interpolation handling in
url()functions by @denbezrukov in #10294 - chore(deps): revert update rust crate mimalloc to 0.1.50 by @dyc3 in #10298
- chore: improve agent behaviour by @ematipico in #10303
- perf(css): deduplicate rules information by @ematipico in #10292
- feat(lint/html/vue): add
useVueValidVForby @dyc3 in #10195 - feat(parse/tailwind): parse arbitrary values as css by @dyc3 in #10299
- docs: fix duplicate-word typos in code comments by @dfedoryshchev in #10310
- docs: replace "allows to" with "allows you to" in code comments and dev docs by @dfedoryshchev in #10311
- ci: release by @github-actions[bot] in #10210
New Contributors
- @dfedoryshchev made their first contribution in #10203
- @realknove made their first contribution in #10201
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.14...@biomejs/biome@2.4.15