Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/tame-pants-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

Fixed [#9081](https://github.com/biomejs/biome/issues/9081): The `noUnknownPseudoElement` rule no longer reports false positives for any known pseudo elements in CSS modules. This was a regression introduced in v2.4.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hyphenate “pseudo-elements”.
It’s the standard compound form.

✏️ Proposed tweak
-Fixed [`#9081`](https://github.com/biomejs/biome/issues/9081): The `noUnknownPseudoElement` rule no longer reports false positives for any known pseudo elements in CSS modules. This was a regression introduced in v2.4.0.
+Fixed [`#9081`](https://github.com/biomejs/biome/issues/9081): The `noUnknownPseudoElement` rule no longer reports false positives for any known pseudo-elements in CSS modules. This was a regression introduced in v2.4.0.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Fixed [#9081](https://github.com/biomejs/biome/issues/9081): The `noUnknownPseudoElement` rule no longer reports false positives for any known pseudo elements in CSS modules. This was a regression introduced in v2.4.0.
Fixed [`#9081`](https://github.com/biomejs/biome/issues/9081): The `noUnknownPseudoElement` rule no longer reports false positives for any known pseudo-elements in CSS modules. This was a regression introduced in v2.4.0.
🧰 Tools
🪛 LanguageTool

[misspelling] ~5-~5: This word is normally spelled with a hyphen.
Context: ...r reports false positives for any known pseudo elements in CSS modules. This was a regression i...

(EN_COMPOUNDS_PSEUDO_ELEMENTS)

🤖 Prompt for AI Agents
In @.changeset/tame-pants-pay.md at line 5, Update the changelog entry text in
.changeset/tame-pants-pay.md to hyphenate "pseudo-elements" (change the phrase
"pseudo elements" to "pseudo-elements") in the sentence referencing the
noUnknownPseudoElement rule so the compound term follows standard style; search
for the substring "noUnknownPseudoElement" or the sentence
"noUnknownPseudoElement rule no longer reports false positives for any known
pseudo elements" and replace with the hyphenated form.

Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,8 @@ fn should_not_trigger(
let lowercase = pseudo_element_name.to_ascii_lowercase_cow();
let lowercase = &lowercase.as_ref();

if file_source.is_css_modules() {
return ["global", "local"].contains(lowercase);
}

!vender_prefix(pseudo_element_name).is_empty()
(file_source.is_css_modules() && ["global", "local"].contains(lowercase))
|| !vender_prefix(pseudo_element_name).is_empty()
|| is_pseudo_elements(lowercase)
|| should_ignore(pseudo_element_name, options)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* should not generate diagnostics */

/* CSS modules specific */
:global(.foo),
:local(.foo) {}

/* https://github.com/biomejs/biome/issues/9081 */
* {
&::after,
&::before {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
source: crates/biome_css_analyze/tests/spec_tests.rs
expression: valid.module.css
---
# Input
```css
/* should not generate diagnostics */

/* CSS modules specific */
:global(.foo),
:local(.foo) {}

/* https://github.com/biomejs/biome/issues/9081 */
* {
&::after,
&::before {}
}

```