Skip to content

Commit

Permalink
fix(linter): false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 7, 2024
1 parent 0d8cc8f commit 80e183b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
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);
}
```

0 comments on commit 80e183b

Please sign in to comment.