-
-
Notifications
You must be signed in to change notification settings - Fork 714
fix(linter): false positive for noDuplicateFontNames
#7156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: cb62685 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 |
WalkthroughThis change refactors the handling of font-family values and duplicate font name detection in the CSS linter. A new dedicated Assessment against linked issues
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{rs,toml}📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
crates/biome_*/**/*📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
**/*.rs📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Files:
🧠 Learnings (21)📓 Common learnings
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:51:05.640Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:51:05.640Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
📚 Learning: 2025-08-05T14:50:18.454Z
Applied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (14)
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css (1)
6-8
: Nice coverage for multi‑word font namesThese additions exercise the false‑positive reported in #7152. Consider adding a couple of edge cases to harden normalisation:
- Quoted vs unquoted mix of the same multi‑identifier font to ensure hashing/eq trims and joins correctly.
- Whitespace/case variations across identifiers (e.g.
SF Mono
vssf mono
) that should normalise to duplicates only when truly the same font.I can draft extra cases if helpful.
crates/biome_css_analyze/tests/quick_test.rs (2)
15-16
: Quick test input aligned with the ruleGood minimal snippet for manual checks. When you unignore this, consider adding a duplicate to assert a diagnostic path too.
22-22
: Rule filter switched correctlyTargeting
"suspicious", "noDuplicateFontNames"
matches the PR’s scope. Optional: un‑comment the assertion and flip it depending on whether you intend this snippet to be valid or invalid..changeset/beige-geckos-heal.md (2)
5-5
: Polish wording and punctuation (en‑GB).Comma around “e.g.” and singular “instance”.
-Fixed [#7152](https://github.com/biomejs/biome/issues/7152). Now the rule `noDuplicateFontNames` correctly detects font names with spaces e.g. `Liberation Mono`. The diagnostic of the rule now points to the first instances of the repeated font. +Fixed [#7152](https://github.com/biomejs/biome/issues/7152). The `noDuplicateFontNames` rule now correctly detects font names with spaces, e.g., `Liberation Mono`. The diagnostic now points to the first instance of the repeated font name.
7-7
: Prefer en‑GB “any more”, and end the sentence with a full stop.Also reads better without a colon before the code block.
-The following example doesn't trigger the rule anymore: +The following example no longer triggers the rule.crates/biome_css_syntax/src/string_ext.rs (1)
5-7
: Slightly simplify withmap
(functional style).Equivalent, avoids the extra
Ok(...)
wrapper.- pub fn inner_string_text(&self) -> SyntaxResult<TokenText> { - Ok(inner_string_text(&self.value_token()?)) - } + pub fn inner_string_text(&self) -> SyntaxResult<TokenText> { + self.value_token().map(|t| inner_string_text(&t)) + }crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs (2)
73-94
: Remove commented‑out legacy code before merging.Dead code in comments ages poorly; the git history preserves it.
- // let font_families = if is_font { - // find_font_family(value_list) - // } else { - // value_list - // .into_iter() - // .filter_map(|v| match v { - // AnyCssGenericComponentValue::AnyCssValue(value) => match value { - // AnyCssValue::CssIdentifier(node) => { - // Some(CssFontValue::SingleValue(node.into())) - // } - // AnyCssValue::CssString(node) => { - // Some(CssFontValue::SingleValue(node.into())) - // } - // _ => None, - // }, - // _ => None, - // }) - // .collect() - // };
115-133
: Diagnostic copy: tiny clarity tweak.Make it explicit that the detail points to the first occurrence.
- .detail(duplicate.range(), markup! { - "This is where the duplicate font name is found:" - }) + .detail(duplicate.range(), markup! { + "First occurrence is here:" + })crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs (1)
121-125
: Unreachable (and allocating) var() checkGiven the new collectors:
find_font_family
skips CSS variables entirely.collect_font_family_properties
filters out functions, sovar(...)
won’t be present.This branch becomes unreachable and also allocates via
to_string()
. Remove it to avoid cost and confusion.Apply:
- // Ignore the last value if it's a CSS variable now. - let last_value = font_families.last()?; - if last_value - .to_string() - .is_some_and(|s| is_css_variable(s.as_ref())) - { - return None; - } - - Some(last_value.range()) + // Report the last family (variables are filtered upstream). + Some(font_families.last()?.range())crates/biome_css_analyze/src/fonts.rs (5)
116-133
: Method name and allocation:to_string()
allocates and can mislead
- Naming
to_string()
shadows the conventional trait method naming. Preferto_css_text()
orraw_text()
to reduce confusion.- It always allocates; most callers only need a view. Consider returning
Option<Cow<str>>
orOption<TokenText>
for the single-value case, and avoid joining forMultipleValue
unless strictly required.If you keep it, document the allocation and intended use-cases.
159-166
: Nit: variable shadowing hurts readability
let value = v.to_trimmed_text(); let lower_case_value = value.text()...
shadows the parameter namevalue
. Rename tovalue_text
for clarity.- while let Some(v) = iter.next() { - let value = v.to_trimmed_text(); - let lower_case_value = value.text().to_ascii_lowercase_cow(); + while let Some(v) = iter.next() { + let value_text = v.to_trimmed_text(); + let lower_case_value = value_text.text().to_ascii_lowercase_cow();
217-225
: Avoid cloning the identifiers bufferYou can avoid cloning by moving out the buffer with
mem::take
:- if !identifiers_collector.is_empty() { - font_families.push(CssFontValue::MultipleValue( - identifiers_collector - .clone() - .into_iter() - .map(AnyCssFontValue::from) - .collect(), - )); - identifiers_collector.clear(); - } + if !identifiers_collector.is_empty() { + let nodes = std::mem::take(&mut identifiers_collector); + font_families.push(CssFontValue::MultipleValue( + nodes.into_iter().map(AnyCssFontValue::from).collect(), + )); + }
254-264
: Same: avoid clone on final MultipleValue pushRepeat the
mem::take
pattern here too.- font_families.push(CssFontValue::MultipleValue( - identifiers_collector - .clone() - .into_iter() - .map(AnyCssFontValue::from) - .collect::<Vec<_>>(), - )); - - identifiers_collector.clear(); + let nodes = std::mem::take(&mut identifiers_collector); + font_families.push(CssFontValue::MultipleValue( + nodes.into_iter().map(AnyCssFontValue::from).collect(), + ));
286-297
: Minor: duplication in keyword lists
is_font_shorthand_keyword
includesFONT_FAMILY_KEYWORDS
butfind_font_family
immediately un-excludes them via!is_font_family_keyword
. It’s fine, but you could simplify by removingFONT_FAMILY_KEYWORDS
from this function to avoid the negation at the call site.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css.snap
is excluded by!**/*.snap
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css.snap
is excluded by!**/*.snap
crates/biome_css_analyze/tests/suppression/suspicious/noDuplicateFontNames/noDuplicateFontNames.css.snap
is excluded by!**/*.snap
📒 Files selected for processing (12)
.changeset/beige-geckos-heal.md
(1 hunks)crates/biome_css_analyze/src/fonts.rs
(1 hunks)crates/biome_css_analyze/src/lib.rs
(1 hunks)crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
(3 hunks)crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
(1 hunks)crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
(4 hunks)crates/biome_css_analyze/src/utils.rs
(1 hunks)crates/biome_css_analyze/tests/quick_test.rs
(1 hunks)crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css
(1 hunks)crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
(1 hunks)crates/biome_css_syntax/src/lib.rs
(3 hunks)crates/biome_css_syntax/src/string_ext.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
.changeset/*.md
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
.changeset/*.md
: Changeset descriptions should be about user-facing changes, use past tense for what you did, present tense for Biome behavior, reference issues/rules/assists with links, include code blocks when applicable, and end every sentence with a full stop.
Headers in changesets should use####
or#####
only; other headers may break the changelog.
Files:
.changeset/beige-geckos-heal.md
🧠 Learnings (68)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_duplicate*_*.rs : Rules that report duplicate entities should use the `noDuplicate<Concept>` naming convention (e.g., `noDuplicateObjectKeys`).
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_duplicate*_*.rs : Rules that report duplicate entities should use the `noDuplicate<Concept>` naming convention (e.g., `noDuplicateObjectKeys`).
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/*.jsonc : Files ending with `.jsonc` in snapshot tests should contain arrays of code snippets for script environments.
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/{invalid*,valid*}* : Snapshot tests for rules should be placed in `tests/specs/<group>/<rule_name>/` with files prefixed by `invalid` or `valid`.
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.
Applied to files:
crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/valid.css
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unused*_*.rs : Rules that report unused entities should use the `noUnused<Concept>` naming convention (e.g., `noUnusedVariables`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:51:23.437Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Use `TypeData::Unknown` to represent cases where type inference is incomplete, and `TypeData::UnknownKeyword` to represent explicit user usage of the TypeScript `unknown` keyword.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a rule provides a code action, add the `fix_kind` metadata to the `declare_lint_rule!` macro and implement the `action` function.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `rule_category!` macro should be used in diagnostics to statically inject the category at compile time.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When a rule needs to query multiple node types, use the `declare_node_union!` macro to define a union type.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file (e.g., `parse_for_statement`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use*_*.rs : Rules that mandate a single concept should be named using the `use<Concept>` prefix (e.g., `useValidLang` for mandating valid HTML `lang` attribute values).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no*_*.rs : Rules that forbid a single concept should be named using the `no<Concept>` prefix (e.g., `noDebugger` for disallowing `debugger` statements).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_constant*_*.rs : Rules that report computations always evaluated to the same value should use the `noConstant<Concept>` naming convention (e.g., `noConstantMathMinMaxClamp`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When implementing the `run` function for a rule, prefer transforming `Result` into `Option` and using the `?` operator for concise code.
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_undeclared*_*.rs : Rules that report undeclared entities should use the `noUndeclared<Concept>` naming convention (e.g., `noUndeclaredVariables`).
Applied to files:
crates/biome_css_analyze/src/lint/correctness/no_unknown_function.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to .changeset/*.md : Changeset descriptions should be about user-facing changes, use past tense for what you did, present tense for Biome behavior, reference issues/rules/assists with links, include code blocks when applicable, and end every sentence with a full stop.
Applied to files:
.changeset/beige-geckos-heal.md
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.
Applied to files:
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
.changeset/beige-geckos-heal.md
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.
Applied to files:
.changeset/beige-geckos-heal.md
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `version` field in `declare_lint_rule!` must be set to `next` for new rules.
Applied to files:
.changeset/beige-geckos-heal.md
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/lib.rs : Add the provided formatting infrastructure code inside your `lib.rs` file when creating a new formatter crate for a language (e.g., biome_html_formatter).
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new prefix (e.g., `html_`) to `LANGUAGE_PREFIXES` in `language_kind.rs` for each new language.
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/{spec_test.rs,spec_tests.rs,language.rs} : Inside the `biome_html_formatter` crate, create a `tests` folder containing a `specs` folder and the files `spec_test.rs`, `spec_tests.rs`, and `language.rs` for test infrastructure.
Applied to files:
crates/biome_css_analyze/src/lib.rs
📚 Learning: 2025-08-05T14:50:35.163Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:35.163Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : When declaring a new diagnostic category, add it to crates/biome_diagnostics_categories/src/categories.rs to ensure it is statically registered.
Applied to files:
crates/biome_css_analyze/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/src/generated/ : Create a `generated/` folder inside the `src/` folder of each new language crate (e.g., `crates/biome_html_syntax/src/generated/`).
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Use boxed slices (`Box<[Box<str>]>`) instead of `Vec<String>` for string arrays in rule options to save memory.
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new variant to `LanguageKind` in `language_kind.rs` for each new language, and implement all required methods for the new variant.
Applied to files:
crates/biome_css_analyze/src/lib.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to **/*.{rs,toml} : Format code (Rust + TOML) using `just format`
Applied to files:
crates/biome_css_analyze/src/lib.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Applied to files:
crates/biome_css_analyze/src/lib.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test.rs`) and snapshot tests in `tests/specs/`.
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:59.193Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Add tests for watcher workspace methods in watcher.tests.rs (src/workspace/watcher.tests.rs)
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Use Rust's `dbg!()` macro for debugging and pass `--show-output` to `cargo` to display debug output during tests.
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Document and test the effect of rule options as part of the rule's documentation and test suite.
Applied to files:
crates/biome_css_analyze/tests/quick_test.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_css_syntax/src/string_ext.rs
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/src/*_kinds_src.rs : Create a new file called `src/<lang>_kinds_src.rs` for each language, which must return a static `KindSrc`.
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Bogus nodes must be part of a variant (e.g., included in a union node definition).
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating a new AST node formatter.
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions should take a `&mut` reference to the parser as their only parameter and return a `ParsedSyntax`.
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_css_syntax/src/lib.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_useless*_*.rs : Rules that report unnecessary code should use the `noUseless<Concept>` naming convention (e.g., `noUselessConstructor`).
Applied to files:
crates/biome_css_analyze/src/utils.rs
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When deprecating a rule, specify the reason using the `deprecated:` field in the `declare_lint_rule!` macro.
Applied to files:
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/use_consistent*_*.rs : Rules that ensure consistency should use the `useConsistent<Concept>` naming convention (e.g., `useConsistentArrayType`).
Applied to files:
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When a rule requires semantic information, use the `Semantic<>` query type and access the semantic model via `ctx.model()`.
Applied to files:
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Rule options must be placed inside the `biome_rule_options` crate, with a file named after the rule (e.g., `use_this_convention.rs`).
Applied to files:
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_misleading*_*.rs : Rules that report misleading code should use the `noMisleading<Concept>` naming convention (e.g., `noMisleadingCharacterClass`).
Applied to files:
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
🪛 LanguageTool
.changeset/beige-geckos-heal.md
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...amescorrectly detects font names with spaces e.g.
Liberation Mono`. The diagnostic ...
(AI_HYDRA_LEO_MISSING_COMMA)
[locale-violation] ~7-~7: In British English, the spelling ‘anymore’ is sometimes considered incorrect. Did you mean “any more”?
Context: ...lowing example doesn't trigger the rule anymore: ```css c { font-family: SF Mono, Libe...
(ANYMORE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: autofix
- GitHub Check: Test Node.js API
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_formatter)
🔇 Additional comments (14)
crates/biome_css_analyze/src/lib.rs (1)
4-4
: Module added cleanly; centralising font helpers is a winLooks good. Ensure public items inside
fonts
arepub(crate)
/pub
as needed for sibling modules; the module itself doesn’t need to bepub
.crates/biome_css_analyze/tests/specs/suspicious/noDuplicateFontNames/invalid.css (1)
6-6
: Keep this invalid duplicate case; newline is fineGood to keep a shorthand
font
example withsans-serif
duplicated. Trailing newline conforms to POSIX conventions.crates/biome_css_syntax/src/string_ext.rs (1)
1-1
: LGTM: clean, crate-local extension.Imports are minimal and the method mirrors the root helper neatly.
crates/biome_css_syntax/src/lib.rs (3)
7-7
: Module hook looks good.Keeping
string_ext
private while exposing the method viaimpl
is spot on.
18-18
: TokenText import is appropriate.Required for the new helper’s return type; no churn elsewhere.
186-196
: Helper is correct and non‑allocating; handles both quote styles.The slice is safe for minimal
""
/''
. Consider a quick unit test covering single/double quotes and a non‑string token.Would you like me to add a small test file verifying:
- CSS_STRING_LITERAL with single and double quotes.
- A non‑string token returns the original
TokenText
untouched?crates/biome_css_analyze/src/utils.rs (2)
14-14
: Good: bring in both case helpers.
StrLikeExtension
andStrOnlyExtension
are both used (to_ascii_lowercase_cow
,to_lowercase_cow
).
3-4
: Import list tidy‑up aligns with the refactor.Font‑related keywords remain referenced here only where needed.
Also applies to: 6-6, 11-11
crates/biome_css_analyze/src/lint/suspicious/no_duplicate_font_names.rs (4)
1-1
: Right direction: use typed font values.Switching to
CssFontValue
/find_font_family
eliminates the substring false positives.
42-44
: Examples updated: great coverage of the original bug.Valid cases with spaced names in both
font-family
andfont
help prevent regressions.
99-105
: Generic family skip applies only tofont
– is that intentional?The comment and linked stylelint thread suggest skipping cases like
"sans-serif", sans-serif
. That can appear underfont-family
too. As written, we skip only when the property isfont
.Two asks:
- Confirm intended parity with stylelint: should generic families be ignored in both
font
andfont-family
?- If yes, drop the
&& is_font
condition.Happy to add targeted tests covering:
font-family: "sans-serif", sans-serif
(no diagnostic if intended).font: 1em "sans-serif", sans-serif
(no diagnostic).
57-57
: State carries both occurrences – nice.Enables the code frame on the first instance. Good call.
crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs (2)
1-4
: Imports update looks goodSwitching to the new fonts module and keeping
is_css_variable
in utils is consistent with the refactor.
176-188
: Collector change looks soundLimiting to identifiers and strings for
font-family
properties is correct given variables/functions are handled elsewhere.
CodSpeed Performance ReportMerging #7156 will not alter performanceComparing Summary
Footnotes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
crates/biome_css_analyze/src/fonts.rs (1)
70-96
: Equality should ignore case to match CSS semantics
PartialEq
still compares trimmed texts with==
, making"SF Mono"
and"sf mono"
different. That contradicts the rule’s goal and the behaviour ofHash
, and was flagged previously. Please compare case-insensitively (eq_ignore_ascii_case
) to keep Hash/Eq in sync.
🧹 Nitpick comments (1)
crates/biome_css_analyze/src/fonts.rs (1)
230-276
: Avoid unnecessary cloning of identifier vectors
identifiers_collector.clone()
is copied into everyCssFontValue::MultipleValue
. Usingstd::mem::take(&mut identifiers_collector)
would move the data out without allocation and then leave you an empty Vec – cheaper and simpler.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crates/biome_css_analyze/src/fonts.rs
(1 hunks)crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_css_analyze/src/lint/a11y/use_generic_font_names.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_css_analyze/src/fonts.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_css_analyze/src/fonts.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_css_analyze/src/fonts.rs
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{use*,no*}_*{vue,react,angular,svelte}*.rs : If a rule overwhelmingly applies to a specific framework, it should be named using the `use<Framework>...` or `no<Framework>...` pattern (e.g., `noVueReservedProps`).
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_duplicate*_*.rs : Rules that report duplicate entities should use the `noDuplicate<Concept>` naming convention (e.g., `noDuplicateObjectKeys`).
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Create new lint rules using `just new-js-lintrule`, `just new-css-lintrule`, `just new-json-lintrule`, or `just new-graphql-lintrule`, and the rule name must be camelCase
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_redundant*_*.rs : Rules that report redundant code should use the `noRedundant<Concept>` naming convention (e.g., `noRedundantUseStrict`).
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Use boxed slices (`Box<[Box<str>]>`) instead of `Vec<String>` for string arrays in rule options to save memory.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_css_analyze/src/fonts.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When implementing the `run` function for a rule, prefer transforming `Result` into `Option` and using the `?` operator for concise code.
Applied to files:
crates/biome_css_analyze/src/fonts.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: autofix
🔇 Additional comments (1)
crates/biome_css_analyze/src/fonts.rs (1)
47-66
: Hash implementation looks solidNice switch to safe
Option
handling; no more panic risk.
Summary
Closes #7152
This PR refactor the data structure that we use to collect font names. The previous implementation couldn't retrieve multiple identifiers like those presented in the issue.
This PR introduced a new type
CssFontValue
which stores multiple nodes in case there are multiple identifiers to define a single font name. This type also implementsHash
andPartialEq
by using the trimmed values of the font name, and it doesn't use the CST ranges. This is documented.This PR also enhances the diagnostic of the rule by adding a code frame for the first occurrence of the font name.
Test Plan
Added new tests
Docs
N/A