diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e30e56364d6..e85cdc4079c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,22 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b ### Linter +- Biome no longer crashes when it encounters a string that contain a multibyte character ([#4181](https://github.com/biomejs/biome/issues/4181)). + + This fixes a regression introduced in Biome 1.9.3 + The regression affected the following linter rules: + + - nursery/useSortedClasses + - nursery/useTrimStartEnd + - style/useTemplate + - suspicious/noMisleadingCharacterClass + + Contributed by @Conaclos + +- Fix [#4190](https://github.com/biomejs/biome/issues/4190), where the rule `noMissingVarFunction` wrongly reported a variable as missing when used inside a `var()` function that was a newline. Contributed by @ematipico + +### Parser + #### Bug Fixes - The CSS parser now accepts more emoji in identifiers ([#3627](https://github.com/biomejs/biome/issues/3627#issuecomment-2392388022)). @@ -45,20 +61,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b } ``` -- Biome no longer crashes when it encounters a string that contain a multibyte character ([#4181](https://github.com/biomejs/biome/issues/4181)). - - This fixes a regression introduced in Biome 1.9.3 - The regression affected the following linter rules: - - - nursery/useSortedClasses - - nursery/useTrimStartEnd - - style/useTemplate - - suspicious/noMisleadingCharacterClass - Contributed by @Conaclos -### Parser - ## v1.9.3 (2024-10-01) ### CLI diff --git a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs index 38675bd7e392..e192963942c4 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_missing_var_function.rs @@ -222,7 +222,7 @@ fn is_wrapped_in_var(node: &CssDashedIdentifier) -> bool { // e.g `color: --custom-property;` // ^^^^^^^^^^^^^^^^ CSS_GENERIC_COMPONENT_VALUE_LIST CssSyntaxKind::CSS_GENERIC_COMPONENT_VALUE_LIST => return false, - CssSyntaxKind::CSS_FUNCTION => return parent.text().starts_with("var"), + CssSyntaxKind::CSS_FUNCTION => return parent.text_trimmed().starts_with("var"), _ => {} } current_node = parent.parent(); diff --git a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css index bbb288bd9017..8ed3b50ccd2e 100644 --- a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css +++ b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css @@ -66,3 +66,10 @@ a { --foo: red; } } + +:root { + --colors-gray-a7: black; + /* The formatter breaks the line */ + --broken-shadow: 0px 0px 1px + var(--colors-gray-a7); +} diff --git a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap index 04c5c0e97268..9eb37f42e50b 100644 --- a/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap +++ b/crates/biome_css_analyze/tests/specs/nursery/noMissingVarFunction/valid.css.snap @@ -73,4 +73,11 @@ a { } } +:root { + --colors-gray-a7: black; + /* The formatter breaks the line */ + --broken-shadow: 0px 0px 1px + var(--colors-gray-a7); +} + ```