Skip to content
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

fix(linter): false positive #4197

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,11 @@ a {
}
}

:root {
--colors-gray-a7: black;
/* The formatter breaks the line */
--broken-shadow: 0px 0px 1px
var(--colors-gray-a7);
}

```