Biome CLI v2.5.14
2.5.14
Patch Changes
- #9022
0d49e24Thanks @dyc3! - Added the nursery rulenoReturnInFinally. This rule disallows return statements inPromise.prototype.finally()callbacks, including inside nested blocks and conditional branches. Returns in nested functions are ignored by the rule.// Invalid: return in finally callback Promise.resolve(1).finally(() => { return 2 }) // Valid: no return in finally callback Promise.resolve(1).finally(() => { console.log(2) })Returning a value from aPromise.prototype.finally()callback does not replace the original promise's fulfillment value, which can be confusing. Returned promises and thenables are awaited, and their rejection rejects the resulting promise. - #11754
71eaa0dThanks @griff-rees! - Added the nursery rulenoSvelteAtDebugTags, which disallows Svelte's{@debug}tag.<!-- Invalid: leftover debugging tag --> {@debug user}The{@debug}tag is a debugging aid and should be removed once you no longer need it, as it should not remain in production code. The rule provides a safe fix that removes the tag. - #11725
5eb5f09Thanks @m1handr! - Added the nursery ruleuseValidTestTitle, which enforces valid titles for unit test cases and suites. - #11735
9bd70c7Thanks @ematipico! - Fixed #8471:source.fixAll.biomeignoredformatter.formatWithErrors. It now applies safe fixes without formatting files that have parse errors when the option is disabled. - #11715
f05a3c3Thanks @ematipico! - Fixed #7771: Grit plugins that usesequentialno longer panic when Biome processes files. - #11766
c2542c6Thanks @dyc3! - Fixed validation ofreadonlyandaccessormodifiers: combining them in either order now reports that they cannot be used together. - #11461
22e9966Thanks @FoundDream! - Fixed #11423: Multiline template interpolations now preserve the indentation of their closing brace when the source indentation is not a multiple oftabWidth.const value = ` ${ condition ? "yes" : "no" -} + } `; - #11766
c2542c6Thanks @dyc3! - Fixed #11763: TypeScript class members usingoverride accessor, such asoverride accessor value = 1, now parse correctly. The reversed order,accessor override, now reports thatoverridemust precedeaccessor. - #11790
17d0ff0Thanks @ematipico! - Fixed #10248:noUselessFragmentsnow allows fragments with props in Astro files, such as{text}inside template expressions. - #11777
7ee3a6cThanks @ematipico! - Fixed #7573: added therequireExplicitCaseoption touseExhaustiveSwitchCases. When set totrue, the rule reports missing cases even when the switch has adefaultclause, so you can keep a runtime fallback while checking that every value in the union has its own case. The option defaults tofalse. - #11751
d37f24bThanks @ematipico! - Fixed #8347: the fix fromuseConsistentArrowReturnnow parenthesizes returned expressions that begin with object literals before removing the arrow function body braces, preventing invalid output for expressions such as object property access. - #11784
46e8912Thanks @dyc3! - Fixed #11782:noUndeclaredCustomPropertiescould hang while checking stylesheets imported by JavaScript modules with many shared dependencies. - #11731
1534885Thanks @ematipico! - Fixed #7984: The fix fromuseSimplifiedLogicExpressionnow preserves line breaks in multiline conditions with line comments, preventing the right-hand side condition from being commented out. - #11735
9bd70c7Thanks @ematipico! - Fixed #7304: the HTML formatter now preserves authored segment breaks between CJK characters, and next to CJK punctuation, instead of replacing them with spaces.- 這個段落是那麼長, 在一行寫不行。 + 這個段落是那麼長, + 在一行寫不行。
- #11749
ff992a1Thanks @ematipico! - Fixed #11747: formatting and checking large parenthesized object expressions no longer exhibit quadratic slowdowns. - #11736
1dd1fc4Thanks @dyc3! - Fixed #8177: code actions no longer modify the wrong part of Vue, Svelte, or Astro files when experimental full HTML support is disabled. - #11743
3835945Thanks @santichausis! - Fixed #10247:biome check --write/biome lint --writenow correctly writes fixes for code inside an HTML attribute expression (for example a Svelteonclick={...}handler, or a mustache expression like{count}), instead of silently reporting the diagnostic as fixable and applying nothing. For example, runningbiome lint --write --unsafeforuseBlockStatements(an unsafe fix) on this Svelte component used to leave the file unchanged: - #11740
8ea8b4aThanks @dyc3! - Fixed #11453:useConsistentTestItnow updates imports alongside calls, preserving the original export through an alias. The rule ignores locally declared functions and withholds fixes when the preferred name would conflict with another binding or global reference. - #11355
27177caThanks @dyc3! - Fixed the HTML formatter incorrectly applying native HTML element formatting to PascalCase component names such as and<Body>in Vue, Svelte, and Astro files.- - content - +content
- #11355
27177caThanks @dyc3! - Fixed the HTML formatter incorrectly applying SVG block formatting to unknown elements whose names matched SVG element names.- - content - +content
- #11741
fc69047Thanks @dyc3! - Fixed #8893:useImportExtensionsno longer suggests adding.tsto.jsximports when a colocated.d.tsfile provides type declarations. - #11642
c87341cThanks @dyc3! - Added the nursery rule useConsistentFunctionStyle, which requires a consistent style for defining functions. By default, the rule reports the following declaration because it requires a function expression assigned to a variable:function greet() { return "Hello"; } - #11770
ddfd622Thanks @dyc3! - Fixed #8980: suppression comments targeting the entireassistcategory are now respected, includingbiome-ignore-all assistwhen runningcheck. - #11792
7a4b895Thanks @dyc3! - Fixed dashed utility base names in the Tailwind parser, includingborder-bs,font-features, andscrollbar-thumb. Classes such asmin-inline-[12rem]now preserve the complete base name and parse the arbitrary value separately. - #11739
1fc17e3Thanks @Netail! - The ruleuseIncludesnow also reportslastIndexOf()comparisons andsome()calls with a strict-equality callback.arr.lastIndexOf(x) !== -1 arr.some(item => item === x)
- #11735
9bd70c7Thanks @ematipico! - Fixed #6888. GritQL plugins can now usecontainson import-clause metavariables such as$clauseinimport $clause from "module"patterns. - #11790
17d0ff0Thanks @ematipico! - Fixed #11786:useAnchorContentnow reports anchors without accessible content in HTML, Astro, Vue, and Svelte even when they have anaria-label,aria-labelledby, ortitleattribute, matching JSX behavior. - #11651
a9c4aa0Thanks @saberoueslati! - Added the new nursery rulenoVueUndeclaredDirectives, which reports custom Vue directives that are not declared by a binding, the component'sdirectivesoption, or the rule'sglobalsoption. Closes #11478. Aliased named imports in single-file components are now tracked under their local name, sonoUndeclaredVariablesrecognizesvHighlightinimport { highlight as vHighlight } from "./directives". - #11715
f05a3c3Thanks @ematipico! - Fixed #7795. ThenoJsxLiteralsrule now ignores surrounding whitespace when matching literals againstallowedStrings. - #11780
99c7049Thanks @ematipico! - Fixed false positives inuseExhaustiveSwitchCaseswhen numeric cases use different spellings of the same value. For example,case 0x1now covers the numeric literal type1. - #11720
c7c4e2bThanks @ematipico! - Fixed #7880:noUselessStringConcatno longer reports literal concatenations split across multiple lines when a numeric literal ends the chain. - #11355
27177caThanks @dyc3! - Improved performance of the HTML formatter for documents that contain many HTML-native or SVG-native tags. - #11720
c7c4e2bThanks @ematipico! - Fixed #7949:useReadonlyClassPropertiesnow reports static class properties that are never reassigned. - #11751
d37f24bThanks @ematipico! - Fixed #7644:useImportExtensionsnow resolves path aliases declared by referenced TypeScript project configurations. - #11791
f88793cThanks @dyc3! - Fixed a false positive inuseTailwindShorthandClassesfor strings in conditional tests, such ascn(m === "w-2 h-2" ? "bg-red-800" : "bg-red-400"). - #11720
c7c4e2bThanks @ematipico! - Fixed #7783:noNoninteractiveElementInteractionsno longer reports event handlers on native elements. - #11733
7030068Thanks @dyc3! - Fixed #11730:useExhaustiveSwitchCasesreports missing cases when iterating over a class property withfor...of. - #11717
2107daeThanks @ternaus! - Fixed #11716: thenoUnknownAttributerule now accepts fullscreen event handlers, thecredentiallessiframe property, and the SVGmaskTypeproperty when the React dependency range allows React 19.3 or later. ThecredentiallessandmaskTypeproperties are restricted to and elements, respectively. - #11737
b7e3559Thanks @dyc3! - Fixed #11692:noFloatingPromisesnow detects unhandled promises returned through generic method signatures, including Playwright fixtures. - #11780
99c7049Thanks @ematipico! - Fixed #7747:useExhaustiveSwitchCasesnow reports missing cases for literal unions derived from const tuples with(typeof values)[number]and objects withkeyof typeof object. Other type-aware rules, includingnoFloatingPromisesandnoUselessTypeConversion, also recognize supported indexed-access results. - #11724
a9a5e9aThanks @dyc3! - Fixed redundant parentheses around binary and logical unary operands with leading line comments.!( // leading - (a || b) + a || b );
- #11715
f05a3c3Thanks @ematipico! - Fixed #7722:noUnusedImportsno longer reports type-only imports used in computed names of declared class properties. - #11731
1534885Thanks @ematipico! - Fixed #6390: Biome now offers suppression actions fornoDynamicNamespaceImportAccessin editors. - #11751
d37f24bThanks @ematipico! - Fixed #7533:noDescendingSpecificityno longer compares selector specificity across separate cascade layer blocks. - #11735
9bd70c7Thanks @ematipico! - Fixed #6206:useUniqueElementIdsno longer reports static IDs on elements in SVG contexts. - #11715
f05a3c3Thanks @ematipico! - Fixed #5447, so the GitHub reporter now associates annotations with the correct files when Biome runs from a nested directory. - #11720
c7c4e2bThanks @ematipico! - Fixed #7816:useHookAtTopLevelno longer reports methods named like hooks when called on another function's result, such asReactotron.configure(...).useReactNative(...). - #11355
27177caThanks @dyc3! - Removed special HTML formatter handling for the obsolete element. - #11731
1534885Thanks @ematipico! - Fixed an issue where Grit plugin code fixes weren't available as editor code actions. - #11726
dea163fThanks @dyc3! - Fixed #11722: the JavaScript formatter inserts a newline before the closing angle bracket when a leading comment forces type arguments onto multiple lines.type Foo = Record< // comment string, - number>; + number +>;
- #9758
02ea438Thanks @Netail! - Added the nursery rulenoJsonUnsafeValues, which disallows JSON values that are unsafe to use between different tools or languages. Invalid:[ 2e308, // Number evaluating to Infinity -2e308, // Number evaluating to -Infinity "\ud83d", // String with lone surrogate 1e-400, // Unsafe zero (too small, will evaluate to 0) 9007199254740992, // Unsafe integer (outside safe integer range) 2.2250738585072009e-308, // Subnormal number ]
- #11790
17d0ff0Thanks @ematipico! - Fixed #8574: the JavaScript formatter sometimes added extra parentheses and moved comments when formatting multiline expressions after operators such as!. Comments now stay beside the values they describe, without an extra pair of parentheses.!( - ( - cond1 || // force this to be multi line - cond3 - ) // comment + cond1 || // force this to be multi line + cond3 // comment );
- #11715
f05a3c3Thanks @ematipico! - Fixed #7711:biome lint --suppressno longer fails with conflicting rule fixes when multiple diagnostics target a declaration preceded by a multiline comment. - #11700
0e9fe53Thanks @dyc3! - Added the nursery rulenoObsoleteTags, which reports obsolete HTML elements in HTML and JSX, such asText. - #11735
9bd70c7Thanks @ematipico! - Fixed #7363: Biome GritQL plugins now match TypeScript interface snippets such asinterface $name { $body }. - #11729
f047985Thanks @m1handr! - Added support forsuite()as an alias ofdescribe()across test analysis rules and formatter. Rules now recognizesuite,fsuite,xsuite, andtest.suiteblocks. The formatter recognises them as test declarations. - #11778
4b7aa1fThanks @ematipico! - Fixed #7727: GritQL snippets such asimport $what from $wherenow match namespace imports, including type-only imports. Explicitimport type $what from $wherepatterns also match type-only named and namespace imports. - #11715
f05a3c3Thanks @ematipico! - Fixed #7603:useSingleJsDocAsteriskno longer reports asterisks that are part of JSDoc comment content, such as italic text, as extra line markers. - #11706
e19512aThanks @dyc3! - Fixed #11704: files re-included by negation patterns in a nested.gitignoreare processed whenvcs.useIgnoreFileis enabled, even when the ignore file contains*. - #11718
76a302aThanks @dyc3! - Fixed #8573: own-line comments before binary operators stay above the operator whenjavascript.formatter.operatorLinebreakis"before".foo - || // comment - bar; + // comment + || bar;
- #9797
64fd314Thanks @Netail! - Added the nursery ruleuseConsistentObjectKeys, which requires JSON object keys to follow a consistent Unicode representation.
What's Changed
- feat(lint/js): add
noReturnInFinallyby @dyc3 in #9022 - fix: honor negation in nested gitignore files by @dyc3 in #11706
- feat(lint/js): add useConsistentFunctionStyle by @dyc3 in #11642
- feat(lint): add noObsoleteTags by @dyc3 in #11700
- fix: closed various bugs by @ematipico in #11715
- fix(noUnknownAttribute): support React 19.3 DOM properties by @ternaus in #11717
- fix(format/js): keep comments above binary operators with operatorLinebreak before by @dyc3 in #11718
- fix(format/js): omit redundant unary operand parentheses by @dyc3 in #11724
- fix(format/js): add newline before closing angle bracket after commented type arguments by @dyc3 in #11726
- feat(biome_js_analyze): implement useValidTestTitle rule (#9176) by @m1handr in #11725
- test(cli): remove path-dependent GitHub reporter snapshot by @dyc3 in #11728
- fix(css_parser): allow final semicolon omission in SCSS at-rules by @denbezrukov in #11714
- fix(analyzer): various bugs by @ematipico in #11720
- fix(useSimplifiedLogicExpression): preserve all trivia by @ematipico in #11731
- feat(markdown): port markdownlint MD040 fenced code language rule by @saberoueslati in #11267
- fix(format): preserve template closing brace indentation by @FoundDream in #11461
- feat: utils for case insensitive binary search by @dyc3 in #11719
- feat(unit_tests): support suite() as an alias of describe() in test rules (#11727) by @m1handr in #11729
- fix(analyzer): infer types for for-of bindings by @dyc3 in #11733
- fix: various bug fixes by @ematipico in #11735
- fix: correct code action offsets in embedded files in legacy htmlish support by @dyc3 in #11736
- chore: lint rules on eslint-react-xyz umbrella-subset relationship by @Netail in #11738
- fix(types): resolve generic method signatures in their own scope by @dyc3 in #11737
- fix(js/parse): avoid consuming huge iterator by @ematipico in #11749
- perf(format/html): replace string comparisons with token set checks by @dyc3 in #11355
- feat(lint/html/svelte): add noSvelteAtDebugTags by @griff-rees in #11754
- fix(html): write fixes back to attribute-expression embeds by @santichausis in #11743
- perf(formatter): skip unnecessary comment and context scans by @denbezrukov in #11753
- fix(css): preserve Sass function call boundaries by @denbezrukov in #11764
- fix(css_parser): parse SCSS module variables in media queries by @denbezrukov in #11765
- feat(type-gen): expand lowering codegen to cover more types by @dyc3 in #11734
- fix(parse/js): fix class member modifier errors by @dyc3 in #11766
- chore(deps): update dependency @changesets/cli to v3.0.2 by @renovate[bot] in #11769
- chore(deps): update dependency @changesets/changelog-github to v1.0.1 by @renovate[bot] in #11768
- chore(deps): update dependency @types/node to v24.13.4 by @renovate[bot] in #11771
- chore(deps): update dependency tombi to v1.5.4 by @renovate[bot] in #11772
- chore(deps): update github-actions by @renovate[bot] in #11773
- chore(deps): update rust crate jiff to 0.2.37 by @renovate[bot] in #11774
- chore(deps): update rust crate ureq to 3.4.2 by @renovate[bot] in #11775
- fix(deps): update @biomejs packages by @renovate[bot] in #11776
- fix: lint rules and typescript reference resolution by @ematipico in #11751
- feat: expand useIncludes by @Netail in #11739
- fix(grit): match import patterns by @ematipico in #11778
- feat(codegen): lower primitive and scalar literal types by @dyc3 in #11756
- feat(type_inference): handle built in global types with class members, lower WeakMap instance members by @dyc3 in #11757
- feat(codegen): lower Set, Map, Date, RegExp class members by @dyc3 in #11758
- feat(codegen): lower iterator and result declarations by @dyc3 in #11759
- feat(html): detect undeclared custom Vue directives by @saberoueslati in #11651
- feat(json_analyze): implement useConsistentObjectKeys by @Netail in #9797
- fix(useConsistentTestIt): update imports with renamed calls by @dyc3 in #11740
- fix(useImportExtensions): support JSX imports with declarations by @dyc3 in #11741
- feat(json_analyze): implement noJsonUnsafeValues by @Netail in #9758
- chore(deps): upgrade rustls by @dyc3 in #11781
- fix(inference): indexed access types by @ematipico in #11780
- fix(css): avoid repeated custom property dependency traversal by @dyc3 in #11784
- refactor(core): retrieve services from salsa by @ematipico in #11779
- fix: formatter and lint rules by @ematipico in #11790
- fix(tailwind): ignore conditional test strings by @dyc3 in #11791
- fix(tailwind): update dashed utility base names by @dyc3 in #11792
- feat(analyze): add @shadcn/lint rule source by @dyc3 in #11793
- fix(suppressions): respect top-level assist category by @dyc3 in #11770
- fix(useExhaustiveSwitchCases): add option
requireExplicitCaseby @ematipico in #11777 - ci: release by @github-actions[bot] in #11711
New Contributors
- @ternaus made their first contribution in #11717
- @m1handr made their first contribution in #11725
- @FoundDream made their first contribution in #11461
- @griff-rees made their first contribution in #11754
Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.13...@biomejs/biome@2.5.14
评论
?
参与讨论