feat(css): support custom media queries - #10941
Conversation
🦋 Changeset detectedLatest commit: 2f06cb1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Organic activityNo automation signals detected in the analyzed events. This is an automated analysis by AgentScan |
945ec8c to
a8fc595
Compare
WalkthroughAdds CSS Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_css_parser/src/syntax/at_rule/feature.rs (1)
43-45: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winWiden the query-feature guard for dashed identifiers.
parse_query_feature_namenow has anis_at_dashed_identifier(p)arm, butis_at_query_feature_namestill only admits variables, identifiers, and interpolation, so(--mobile)never reaches it. Addis_at_dashed_identifier(p)to the guard.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/biome_css_parser/src/syntax/at_rule/feature.rs` around lines 43 - 45, Update is_at_query_feature_name to also accept is_at_dashed_identifier(p), preserving the existing variable, identifier, and interpolation checks so dashed query feature names reach parse_query_feature_name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/giant-vans-ring.md:
- Line 5: Update the changeset entry to begin with the required link to issue
`#10855`, then retain or revise the release note to describe support for parsing
and formatting CSS custom media queries declared with `@custom-media`.
In `@crates/biome_css_parser/src/syntax/at_rule/custom_media.rs`:
- Around line 34-54: The parse_custom_media_at_rule_declarator function
currently ignores a missing dashed identifier; replace the silent
parse_dashed_identifier(p).ok() handling with the existing
expected_dashed_identifier diagnostic so invalid declarators such as boolean or
parenthesized media queries without a name report an error.
---
Outside diff comments:
In `@crates/biome_css_parser/src/syntax/at_rule/feature.rs`:
- Around line 43-45: Update is_at_query_feature_name to also accept
is_at_dashed_identifier(p), preserving the existing variable, identifier, and
interpolation checks so dashed query feature names reach
parse_query_feature_name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 527d46df-033f-41fd-9795-aba81046f6fd
⛔ Files ignored due to path filters (16)
crates/biome_css_analyze/tests/specs/correctness/noUnknownMediaFeatureName/valid.css.snapis excluded by!**/*.snapand included by**crates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules/valid.css.snapis excluded by!**/*.snapand included by**crates/biome_css_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_formatter/tests/specs/prettier/css/atrule/custom-media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/case/case.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/cssnext-example/cssnext-example.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/custom-media-queries/custom-media-queries.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/media-queries-ranges/media-queries-ranges.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_custom_media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (24)
.changeset/giant-vans-ring.mdcrates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rscrates/biome_css_analyze/src/lint/nursery/use_baseline.rscrates/biome_css_analyze/tests/specs/correctness/noUnknownMediaFeatureName/valid.csscrates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules/valid.csscrates/biome_css_formatter/src/css/any/at_rule.rscrates/biome_css_formatter/src/css/any/custom_media_query.rscrates/biome_css_formatter/src/css/any/mod.rscrates/biome_css_formatter/src/css/any/query_feature_name.rscrates/biome_css_formatter/src/css/auxiliary/boolean_media_query.rscrates/biome_css_formatter/src/css/auxiliary/custom_media_at_rule_declarator.rscrates/biome_css_formatter/src/css/auxiliary/mod.rscrates/biome_css_formatter/src/css/statements/custom_media_at_rule.rscrates/biome_css_formatter/src/css/statements/mod.rscrates/biome_css_formatter/src/generated.rscrates/biome_css_parser/src/lexer/mod.rscrates/biome_css_parser/src/syntax/at_rule/custom_media.rscrates/biome_css_parser/src/syntax/at_rule/feature.rscrates/biome_css_parser/src/syntax/at_rule/mod.rscrates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_custom_media.csscrates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.csscrates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rsxtask/codegen/css.ungramxtask/codegen/src/css_kinds_src.rs
Merging this PR will not alter performance
Comparing Footnotes
|
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@biomejs/biome": minor | |||
There was a problem hiding this comment.
Historically, we've alwawys shipped parser enhancements in patches unless there's a specific reason (experimental feature, non-official spec, etc.)
There was a problem hiding this comment.
@ematipico Changed it to a patch and rebased onto main :)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/giant-vans-ring.md:
- Line 5: Update the issue reference in the changeset entry from `#10855` to
`#10884`, keeping the existing description and custom-media links unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8c01eb91-6d9b-4b89-ace4-800af684fbda
📒 Files selected for processing (2)
.changeset/giant-vans-ring.mdcrates/biome_css_parser/src/syntax/at_rule/custom_media.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_css_parser/src/syntax/at_rule/custom_media.rs
1446c77 to
d12cd18
Compare
|
|
||
| AnyCssQueryFeatureName = | ||
| CssIdentifier | ||
| | CssDashedIdentifier |
There was a problem hiding this comment.
what do we cover here?
There was a problem hiding this comment.
Here:
@custom-media --mobile-viewport (max-width: 768px);
@media only screen and (--mobile-viewport) {}
^^^^^^^^^^^^^^^^^There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/biome_css_formatter/tests/specs/css/atrule/custom_media.css (1)
1-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover boolean declarations and media-query references.
This fixture currently exercises only
@custom-mediadeclarations backed by media-query lists. Addtrue/falsedeclarations and an@media (--medium-screen)case so the new parser and formatter branches cannot quietly regress.Suggested additions
+@custom-media --always true; +@custom-media --never false; + +@media (--medium-screen) { + .card { + color: red; + } +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/biome_css_formatter/tests/specs/css/atrule/custom_media.css` around lines 1 - 10, Extend the custom-media fixture with boolean declarations for both true and false values, and add an `@media` rule referencing --medium-screen. Keep the existing media-query-list declarations unchanged while ensuring the new cases exercise boolean parsing/formatting and media-query references.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/biome_css_formatter/tests/specs/css/atrule/custom_media.css`:
- Around line 1-10: Extend the custom-media fixture with boolean declarations
for both true and false values, and add an `@media` rule referencing
--medium-screen. Keep the existing media-query-list declarations unchanged while
ensuring the new cases exercise boolean parsing/formatting and media-query
references.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5b027ff8-9f4f-4983-84d7-2e37b1b01218
⛔ Files ignored due to path filters (17)
crates/biome_css_analyze/tests/specs/correctness/noUnknownMediaFeatureName/valid.css.snapis excluded by!**/*.snapand included by**crates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules/valid.css.snapis excluded by!**/*.snapand included by**crates/biome_css_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_formatter/tests/specs/css/atrule/custom_media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/atrule/custom-media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/case/case.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/cssnext-example/cssnext-example.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/custom-media-queries/custom-media-queries.css.snapis excluded by!**/*.snapand included by**crates/biome_css_formatter/tests/specs/prettier/css/stylefmt-repo/media-queries-ranges/media-queries-ranges.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_custom_media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snapis excluded by!**/*.snapand included by**crates/biome_css_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (25)
.changeset/giant-vans-ring.mdcrates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rscrates/biome_css_analyze/src/lint/nursery/use_baseline.rscrates/biome_css_analyze/tests/specs/correctness/noUnknownMediaFeatureName/valid.csscrates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules/valid.csscrates/biome_css_formatter/src/css/any/at_rule.rscrates/biome_css_formatter/src/css/any/custom_media_query.rscrates/biome_css_formatter/src/css/any/mod.rscrates/biome_css_formatter/src/css/any/query_feature_name.rscrates/biome_css_formatter/src/css/auxiliary/boolean_media_query.rscrates/biome_css_formatter/src/css/auxiliary/custom_media_at_rule_declarator.rscrates/biome_css_formatter/src/css/auxiliary/mod.rscrates/biome_css_formatter/src/css/statements/custom_media_at_rule.rscrates/biome_css_formatter/src/css/statements/mod.rscrates/biome_css_formatter/src/generated.rscrates/biome_css_formatter/tests/specs/css/atrule/custom_media.csscrates/biome_css_parser/src/lexer/mod.rscrates/biome_css_parser/src/syntax/at_rule/custom_media.rscrates/biome_css_parser/src/syntax/at_rule/feature.rscrates/biome_css_parser/src/syntax/at_rule/mod.rscrates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_custom_media.csscrates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.csscrates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rsxtask/codegen/css.ungramxtask/codegen/src/css_kinds_src.rs
🚧 Files skipped from review as they are similar to previous changes (21)
- xtask/codegen/src/css_kinds_src.rs
- crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_custom_media.css
- .changeset/giant-vans-ring.md
- crates/biome_css_formatter/src/css/any/custom_media_query.rs
- crates/biome_css_formatter/src/css/any/mod.rs
- crates/biome_css_analyze/src/lint/nursery/use_baseline.rs
- crates/biome_css_formatter/src/css/any/query_feature_name.rs
- crates/biome_css_formatter/src/css/auxiliary/custom_media_at_rule_declarator.rs
- crates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules/valid.css
- crates/biome_css_parser/src/lexer/mod.rs
- crates/biome_css_formatter/src/css/any/at_rule.rs
- crates/biome_css_formatter/src/css/auxiliary/boolean_media_query.rs
- crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs
- crates/biome_css_analyze/src/lint/correctness/no_unknown_media_feature_name.rs
- crates/biome_css_formatter/src/css/statements/mod.rs
- crates/biome_css_parser/src/syntax/at_rule/mod.rs
- xtask/codegen/css.ungram
- crates/biome_css_parser/src/syntax/at_rule/feature.rs
- crates/biome_css_formatter/src/css/statements/custom_media_at_rule.rs
- crates/biome_css_formatter/src/css/auxiliary/mod.rs
- crates/biome_css_formatter/src/generated.rs
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@biomejs/biome](https://biomejs.dev) ([source](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)) | imports | patch | [`2.5.4` -> `2.5.5`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/2.5.4/2.5.5) | --- ### Release Notes <details> <summary>biomejs/biome (@​biomejs/biome)</summary> ### [`v2.5.5`](https://github.com/biomejs/biome/blob/HEAD/packages/@​biomejs/biome/CHANGELOG.md#255) [Compare Source](https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.4...@biomejs/biome@2.5.5) ##### Patch Changes - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`useExhaustiveSwitchCases`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) for unions of bigint literals. The rule now reports missing bigint cases and compares bigint literals by value, including binary, octal, hexadecimal, and separator-containing spellings. For example, this switch now reports the missing `2n` case: ```ts declare const value: 1n | 2n; switch (value) { case 1n: break; } ``` - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed false positives in [`noBaseToString`](https://biomejs.dev/linter/rules/no-base-to-string/) and [`useNullishCoalescing`](https://biomejs.dev/linter/rules/use-nullish-coalescing/) when member, stringification, or nullish inference cannot complete. These rules now suppress diagnostics instead of reporting from partial type information. For example, neither expression is reported when a recursive type cannot be fully resolved: ```ts type Recursive = Recursive; declare const value: Recursive; String(value); value || "fallback"; ``` - [#​10977](biomejs/biome#10977) [`0bf7486`](biomejs/biome@0bf7486) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10922](biomejs/biome#10922): the action [`useSortedAttributes`](https://biomejs.dev/assist/actions/use-sorted-attributes/) no longer triggers for HTML instructions. - [#​10957](biomejs/biome#10957) [`cf263c4`](biomejs/biome@cf263c4) Thanks [@​dyc3](https://github.com/dyc3)! - Fixed [`noThenProperty`](https://biomejs.dev/linter/rules/no-then-property/) failing to detect `Object.fromEntries`, `Object.defineProperty`, and `Reflect.defineProperty` calls with comments between their tokens. - [#​10983](biomejs/biome#10983) [`edc0ed7`](biomejs/biome@edc0ed7) Thanks [@​ayaangazali](https://github.com/ayaangazali)! - Fixed [#​10980](biomejs/biome#10980): [`useAriaPropsSupportedByRole`](https://biomejs.dev/linter/rules/use-aria-props-supported-by-role/) no longer reports false positives when the attribute that determines an element's implicit ARIA role is written as a shorthand attribute, such as `<a {href} aria-label="...">` in Astro and Svelte files. Shorthand attributes are now taken into account when computing the implicit role, so the anchor above correctly resolves to the `link` role instead of `generic`. - [#​10889](biomejs/biome#10889) [`89526e3`](biomejs/biome@89526e3) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed CSS formatter casing for syntax-owned names while preserving author-defined names, including scoped keyframes and container scroll-state queries. ```diff - A:HOVER { COLOR: INITIAL; } + A:hover { color: initial; } - @​KEYFRAMES :GLOBAL KeepFrames { FROM { COLOR: RED; } } + @​keyframes :GLOBAL KeepFrames { from { color: RED; } } - @​CONTAINER scroll-state((SCROLLED: TOP) AND (STUCK)) { A:HOVER { COLOR: RED; } } + @​container scroll-state((SCROLLED: TOP) AND (STUCK)) { A:hover { color: RED; } } ``` - [#​10964](biomejs/biome#10964) [`794ccd0`](biomejs/biome@794ccd0) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed CSS formatting for comments between declaration values and `!important`. ```diff -a { color: /* before */ /* after */ red !important; } +a { color: /* before */ red /* after */ !important; } ``` - [#​10993](biomejs/biome#10993) [`b7a9694`](biomejs/biome@b7a9694) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed the CSS formatter to preserve comments on the correct side of selector combinators and before declaration blocks. ```diff -.before > /* comment */ .after {} +.before /* comment */ > .after {} ``` It now also keeps selectors with escaped newlines in attribute values inline when they fit. ```diff -div - span[foo="bar\ +div span[foo="bar\ value"] {} ``` - [#​10978](biomejs/biome#10978) [`8ebafe1`](biomejs/biome@8ebafe1) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10870](biomejs/biome#10870): [`noUnresolvedImports`](https://biomejs.dev/linter/rules/no-unresolved-imports/) no longer reports false positives such as `import type { NextRequest } from "next/server"`. - [#​10901](biomejs/biome#10901) [`68c10e6`](biomejs/biome@68c10e6) Thanks [@​Socialpranker](https://github.com/Socialpranker)! - Fixed [#​10622](biomejs/biome#10622): the HTML/Vue parser no longer panics on the argument-less `v-bind` shorthand (`:="props"`). This syntax is valid Vue and equivalent to `v-bind="props"`, so the parser now accepts it (along with the longhand `v-bind:="props"`) instead of crashing while building a diagnostic for a missing argument. - [#​10936](biomejs/biome#10936) [`7df46f5`](biomejs/biome@7df46f5) Thanks [@​ematipico](https://github.com/ematipico)! - Improved generic tuple inference for [`useIncludes`](https://biomejs.dev/linter/rules/use-includes/). The rule now recognizes specialised tuple element types returned through generic aliases. - [#​10941](biomejs/biome#10941) [`f787725`](biomejs/biome@f787725) Thanks [@​siketyan](https://github.com/siketyan)! - Fixed [`#10855`](biomejs/biome#10855): Biome now supports parsing and formatting CSS custom media queries declared with [`@custom-media`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@​custom-media). - [#​10969](biomejs/biome#10969) [`72d309b`](biomejs/biome@72d309b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed an issue where Biome logs became too verbose, dumping information not relevant to user's operations. - [`e62f6b6`](biomejs/biome@e62f6b6) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10963](biomejs/biome#10963): Biome no longer panics when a type-aware rule such as [`noFloatingPromises`](https://biomejs.dev/linter/rules/no-floating-promises/) checks a call to a function with multiple call signatures imported from another module. - [#​10931](biomejs/biome#10931) [`899c60d`](biomejs/biome@899c60d) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed `check --write` command. Now the command reports code frame of the formatted code, if the formatter is enabled. - [#​10904](biomejs/biome#10904) [`ceee4f4`](biomejs/biome@ceee4f4) Thanks [@​qzwxsaedc](https://github.com/qzwxsaedc)! - Fixed [#​10892](biomejs/biome#10892): [`noUnnecessaryConditions`](https://biomejs.dev/linter/rules/no-unnecessary-conditions/) no longer reports a false positive when checking a member of a discriminated union that is accessed through a default type-only namespace import. The following code is no longer flagged: ```ts import type Types from "./types"; declare function parse(): Types.Result<string>; const result = parse(); if (!result.success) { } ``` - [#​10962](biomejs/biome#10962) [`f0a67f2`](biomejs/biome@f0a67f2) Thanks [@​ematipico](https://github.com/ematipico)! - Biome no longer removes embedded styles and scripts in HTML files. - [#​11000](biomejs/biome#11000) [`5039a1e`](biomejs/biome@5039a1e) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed a bug where closing one editor stopped a shared Biome daemon used by other editors. LSP proxy processes now exit when either the editor or daemon disconnects. - [#​10957](biomejs/biome#10957) [`cf263c4`](biomejs/biome@cf263c4) Thanks [@​dyc3](https://github.com/dyc3)! - Improved the performance of the [`noThenProperty`](https://biomejs.dev/linter/rules/no-then-property/) lint rule by about 50%. - [#​10992](biomejs/biome#10992) [`4bf9b21`](biomejs/biome@4bf9b21) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/): The rule now reports Promise-returning callbacks where a synchronous callback is expected when calls use tuple spreads or tuple rest parameters, including generic and deeply nested tuples, and when constructor signatures come from interface or object types. Recursive or excessively nested tuple spreads use a conservative fallback so analysis terminates. For example, the following callback is now reported. ```ts declare function consume(...args: [number, () => void]): void; const prefix: [number] = [1]; consume(...prefix, async () => {}); ``` - [#​10915](biomejs/biome#10915) [`b3b12b3`](biomejs/biome@b3b12b3) Thanks [@​Functionhx](https://github.com/Functionhx)! - Added the rule [`noNegationInEqualityCheck`](https://biomejs.dev/linter/rules/no-negation-in-equality-check/). The rule flags negated expressions on the left side of strict equality checks like `!foo === bar` — due to operator precedence this evaluates as `(!foo) === bar` which is almost always a mistake for `foo !== bar`. The rule provides an unsafe fix that flips the operator. ```js // Invalid !foo === bar; !foo !== bar; // Valid foo !== bar; foo === bar; ``` - [#​10970](biomejs/biome#10970) [`bd1038b`](biomejs/biome@bd1038b) Thanks [@​ematipico](https://github.com/ematipico)! - Improved overload selection for [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/). Biome now handles overloaded calls, overloaded constructors, rest parameters, union arguments, and generic constraints without selecting an incompatible signature. For example, `noMisusedPromises` now reports the async callback passed to the synchronous overload: ```ts declare function consume(kind: "async", callback: () => Promise<void>): void; declare function consume(kind: "sync", callback: () => void): void; consume("sync", async () => {}); ``` - [#​10933](biomejs/biome#10933) [`48a4abb`](biomejs/biome@48a4abb) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`useArrayFind`](https://biomejs.dev/linter/rules/use-array-find/) to recognize bigint zero indexes. - [#​10931](biomejs/biome#10931) [`899c60d`](biomejs/biome@899c60d) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed an orchestration issue that could lead to deadlocks when type-aware rules are enabled. - [#​10969](biomejs/biome#10969) [`72d309b`](biomejs/biome@72d309b) Thanks [@​ematipico](https://github.com/ematipico)! - Hardened the Biome Language Server by improving its synchronisation logic. - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed false positives in [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/) and [`useAwaitThenable`](https://biomejs.dev/linter/rules/use-await-thenable/) when Promise or thenable inference cannot complete. These rules now suppress diagnostics instead of treating incomplete type information as a definite result. For example, `useAwaitThenable` no longer reports `await value` when the value's thenability is unknown: ```ts declare const value: unknown; async function consume() { await value; } ``` </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzIuNCIsInVwZGF0ZWRJblZlciI6IjQzLjI3Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Client/pulls/14
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@biomejs/biome](https://biomejs.dev) ([source](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)) | imports | patch | [`2.5.4` -> `2.5.5`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/2.5.4/2.5.5) | --- ### Release Notes <details> <summary>biomejs/biome (@​biomejs/biome)</summary> ### [`v2.5.5`](https://github.com/biomejs/biome/blob/HEAD/packages/@​biomejs/biome/CHANGELOG.md#255) [Compare Source](https://github.com/biomejs/biome/compare/@biomejs/biome@2.5.4...@biomejs/biome@2.5.5) ##### Patch Changes - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`useExhaustiveSwitchCases`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) for unions of bigint literals. The rule now reports missing bigint cases and compares bigint literals by value, including binary, octal, hexadecimal, and separator-containing spellings. For example, this switch now reports the missing `2n` case: ```ts declare const value: 1n | 2n; switch (value) { case 1n: break; } ``` - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed false positives in [`noBaseToString`](https://biomejs.dev/linter/rules/no-base-to-string/) and [`useNullishCoalescing`](https://biomejs.dev/linter/rules/use-nullish-coalescing/) when member, stringification, or nullish inference cannot complete. These rules now suppress diagnostics instead of reporting from partial type information. For example, neither expression is reported when a recursive type cannot be fully resolved: ```ts type Recursive = Recursive; declare const value: Recursive; String(value); value || "fallback"; ``` - [#​10977](biomejs/biome#10977) [`0bf7486`](biomejs/biome@0bf7486) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10922](biomejs/biome#10922): the action [`useSortedAttributes`](https://biomejs.dev/assist/actions/use-sorted-attributes/) no longer triggers for HTML instructions. - [#​10957](biomejs/biome#10957) [`cf263c4`](biomejs/biome@cf263c4) Thanks [@​dyc3](https://github.com/dyc3)! - Fixed [`noThenProperty`](https://biomejs.dev/linter/rules/no-then-property/) failing to detect `Object.fromEntries`, `Object.defineProperty`, and `Reflect.defineProperty` calls with comments between their tokens. - [#​10983](biomejs/biome#10983) [`edc0ed7`](biomejs/biome@edc0ed7) Thanks [@​ayaangazali](https://github.com/ayaangazali)! - Fixed [#​10980](biomejs/biome#10980): [`useAriaPropsSupportedByRole`](https://biomejs.dev/linter/rules/use-aria-props-supported-by-role/) no longer reports false positives when the attribute that determines an element's implicit ARIA role is written as a shorthand attribute, such as `<a {href} aria-label="...">` in Astro and Svelte files. Shorthand attributes are now taken into account when computing the implicit role, so the anchor above correctly resolves to the `link` role instead of `generic`. - [#​10889](biomejs/biome#10889) [`89526e3`](biomejs/biome@89526e3) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed CSS formatter casing for syntax-owned names while preserving author-defined names, including scoped keyframes and container scroll-state queries. ```diff - A:HOVER { COLOR: INITIAL; } + A:hover { color: initial; } - @​KEYFRAMES :GLOBAL KeepFrames { FROM { COLOR: RED; } } + @​keyframes :GLOBAL KeepFrames { from { color: RED; } } - @​CONTAINER scroll-state((SCROLLED: TOP) AND (STUCK)) { A:HOVER { COLOR: RED; } } + @​container scroll-state((SCROLLED: TOP) AND (STUCK)) { A:hover { color: RED; } } ``` - [#​10964](biomejs/biome#10964) [`794ccd0`](biomejs/biome@794ccd0) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed CSS formatting for comments between declaration values and `!important`. ```diff -a { color: /* before */ /* after */ red !important; } +a { color: /* before */ red /* after */ !important; } ``` - [#​10993](biomejs/biome#10993) [`b7a9694`](biomejs/biome@b7a9694) Thanks [@​denbezrukov](https://github.com/denbezrukov)! - Fixed the CSS formatter to preserve comments on the correct side of selector combinators and before declaration blocks. ```diff -.before > /* comment */ .after {} +.before /* comment */ > .after {} ``` It now also keeps selectors with escaped newlines in attribute values inline when they fit. ```diff -div - span[foo="bar\ +div span[foo="bar\ value"] {} ``` - [#​10978](biomejs/biome#10978) [`8ebafe1`](biomejs/biome@8ebafe1) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10870](biomejs/biome#10870): [`noUnresolvedImports`](https://biomejs.dev/linter/rules/no-unresolved-imports/) no longer reports false positives such as `import type { NextRequest } from "next/server"`. - [#​10901](biomejs/biome#10901) [`68c10e6`](biomejs/biome@68c10e6) Thanks [@​Socialpranker](https://github.com/Socialpranker)! - Fixed [#​10622](biomejs/biome#10622): the HTML/Vue parser no longer panics on the argument-less `v-bind` shorthand (`:="props"`). This syntax is valid Vue and equivalent to `v-bind="props"`, so the parser now accepts it (along with the longhand `v-bind:="props"`) instead of crashing while building a diagnostic for a missing argument. - [#​10936](biomejs/biome#10936) [`7df46f5`](biomejs/biome@7df46f5) Thanks [@​ematipico](https://github.com/ematipico)! - Improved generic tuple inference for [`useIncludes`](https://biomejs.dev/linter/rules/use-includes/). The rule now recognizes specialised tuple element types returned through generic aliases. - [#​10941](biomejs/biome#10941) [`f787725`](biomejs/biome@f787725) Thanks [@​siketyan](https://github.com/siketyan)! - Fixed [`#10855`](biomejs/biome#10855): Biome now supports parsing and formatting CSS custom media queries declared with [`@custom-media`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@​custom-media). - [#​10969](biomejs/biome#10969) [`72d309b`](biomejs/biome@72d309b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed an issue where Biome logs became too verbose, dumping information not relevant to user's operations. - [`e62f6b6`](biomejs/biome@e62f6b6) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [#​10963](biomejs/biome#10963): Biome no longer panics when a type-aware rule such as [`noFloatingPromises`](https://biomejs.dev/linter/rules/no-floating-promises/) checks a call to a function with multiple call signatures imported from another module. - [#​10931](biomejs/biome#10931) [`899c60d`](biomejs/biome@899c60d) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed `check --write` command. Now the command reports code frame of the formatted code, if the formatter is enabled. - [#​10904](biomejs/biome#10904) [`ceee4f4`](biomejs/biome@ceee4f4) Thanks [@​qzwxsaedc](https://github.com/qzwxsaedc)! - Fixed [#​10892](biomejs/biome#10892): [`noUnnecessaryConditions`](https://biomejs.dev/linter/rules/no-unnecessary-conditions/) no longer reports a false positive when checking a member of a discriminated union that is accessed through a default type-only namespace import. The following code is no longer flagged: ```ts import type Types from "./types"; declare function parse(): Types.Result<string>; const result = parse(); if (!result.success) { } ``` - [#​10962](biomejs/biome#10962) [`f0a67f2`](biomejs/biome@f0a67f2) Thanks [@​ematipico](https://github.com/ematipico)! - Biome no longer removes embedded styles and scripts in HTML files. - [#​11000](biomejs/biome#11000) [`5039a1e`](biomejs/biome@5039a1e) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed a bug where closing one editor stopped a shared Biome daemon used by other editors. LSP proxy processes now exit when either the editor or daemon disconnects. - [#​10957](biomejs/biome#10957) [`cf263c4`](biomejs/biome@cf263c4) Thanks [@​dyc3](https://github.com/dyc3)! - Improved the performance of the [`noThenProperty`](https://biomejs.dev/linter/rules/no-then-property/) lint rule by about 50%. - [#​10992](biomejs/biome#10992) [`4bf9b21`](biomejs/biome@4bf9b21) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/): The rule now reports Promise-returning callbacks where a synchronous callback is expected when calls use tuple spreads or tuple rest parameters, including generic and deeply nested tuples, and when constructor signatures come from interface or object types. Recursive or excessively nested tuple spreads use a conservative fallback so analysis terminates. For example, the following callback is now reported. ```ts declare function consume(...args: [number, () => void]): void; const prefix: [number] = [1]; consume(...prefix, async () => {}); ``` - [#​10915](biomejs/biome#10915) [`b3b12b3`](biomejs/biome@b3b12b3) Thanks [@​Functionhx](https://github.com/Functionhx)! - Added the rule [`noNegationInEqualityCheck`](https://biomejs.dev/linter/rules/no-negation-in-equality-check/). The rule flags negated expressions on the left side of strict equality checks like `!foo === bar` — due to operator precedence this evaluates as `(!foo) === bar` which is almost always a mistake for `foo !== bar`. The rule provides an unsafe fix that flips the operator. ```js // Invalid !foo === bar; !foo !== bar; // Valid foo !== bar; foo === bar; ``` - [#​10970](biomejs/biome#10970) [`bd1038b`](biomejs/biome@bd1038b) Thanks [@​ematipico](https://github.com/ematipico)! - Improved overload selection for [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/). Biome now handles overloaded calls, overloaded constructors, rest parameters, union arguments, and generic constraints without selecting an incompatible signature. For example, `noMisusedPromises` now reports the async callback passed to the synchronous overload: ```ts declare function consume(kind: "async", callback: () => Promise<void>): void; declare function consume(kind: "sync", callback: () => void): void; consume("sync", async () => {}); ``` - [#​10933](biomejs/biome#10933) [`48a4abb`](biomejs/biome@48a4abb) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed [`useArrayFind`](https://biomejs.dev/linter/rules/use-array-find/) to recognize bigint zero indexes. - [#​10931](biomejs/biome#10931) [`899c60d`](biomejs/biome@899c60d) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed an orchestration issue that could lead to deadlocks when type-aware rules are enabled. - [#​10969](biomejs/biome#10969) [`72d309b`](biomejs/biome@72d309b) Thanks [@​ematipico](https://github.com/ematipico)! - Hardened the Biome Language Server by improving its synchronisation logic. - [#​10972](biomejs/biome#10972) [`ab8c21b`](biomejs/biome@ab8c21b) Thanks [@​ematipico](https://github.com/ematipico)! - Fixed false positives in [`noMisusedPromises`](https://biomejs.dev/linter/rules/no-misused-promises/) and [`useAwaitThenable`](https://biomejs.dev/linter/rules/use-await-thenable/) when Promise or thenable inference cannot complete. These rules now suppress diagnostics instead of treating incomplete type information as a definite result. For example, `useAwaitThenable` no longer reports `await value` when the value's thenability is unknown: ```ts declare const value: unknown; async function consume() { await value; } ``` </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzIuNCIsInVwZGF0ZWRJblZlciI6IjQzLjI3Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/31
Summary
Closes #10855
Added support for parsing custom media queries. Previously, it was caught by
noUnknownMediaFeatureNameandnoUnknownAtRulesrules.AI Assistance Disclosure: I used Codex for authoring a changeset. Other changes are all written by hand.
Test Plan
Added snapshot tests.
Docs
N/A