Skip to content

fix(lint): regression of the noUnknownPseudoElement rule#9100

Merged
ematipico merged 1 commit intomainfrom
fix/GH-9081
Feb 16, 2026
Merged

fix(lint): regression of the noUnknownPseudoElement rule#9100
ematipico merged 1 commit intomainfrom
fix/GH-9081

Conversation

@siketyan
Copy link
Member

@siketyan siketyan commented Feb 16, 2026

Summary

Fixes #9081

There was a regression that the rule don't accept any pseudo elements anymore except :global and :local in CSS modules.

Test Plan

Added snapshot tests

Docs

N/A

@siketyan siketyan requested review from a team February 16, 2026 13:31
@siketyan siketyan self-assigned this Feb 16, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 08c0eef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions bot added A-Linter Area: linter L-CSS Language: CSS labels Feb 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

Adds a patch changelog entry for a fix addressing issue #9081: the noUnknownPseudoElement rule no longer reports false positives for known CSS module pseudo-elements. Refactors the CSS analyzer's early-return logic by consolidating checks so CSS modules only bypass validation for global and local pseudo-elements (and vendor-prefixed names are still allowed). Adds a CSS module test with :global/:local and ::after/::before cases to verify correct behaviour.

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(lint): regression of the noUnknownPseudoElement rule' clearly and concisely summarises the main fix—addressing a regression in the linting rule that was introduced in version 2.4.0.
Description check ✅ Passed The description directly addresses the changeset by referencing issue #9081, explaining the regression affecting CSS Modules pseudo-elements, and outlining the test plan added.
Linked Issues check ✅ Passed The code changes align with issue #9081 objectives. The rule logic now correctly accepts pseudo-elements in CSS Modules while still rejecting unknown ones, fixing the false positives on standard pseudo-elements like ::after.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the noUnknownPseudoElement regression: updating the rule logic, adding a changelog entry, and including test cases for CSS Modules.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/GH-9081

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.changeset/tame-pants-pay.md:
- Line 5: Update the changeset sentence to correct grammar and clearly state the
behavior: change "Fixed ... report" to "Fixed ... reports" and use past tense
for the action ("Fixed"). Then explicitly list which selectors are now accepted
by the rule to clarify behavior — reference the rule name noUnknownPseudoElement
and state that CSS module-scoped selectors such as :local(...), :global(...),
and module-generated class selectors (e.g., .foo or .foo___hash) are no longer
flagged; keep the description concise and use present tense when describing
Biome behavior.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 16, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 126 skipped benchmarks1


Comparing fix/GH-9081 (08c0eef) with main (89d6384)

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.changeset/tame-pants-pay.md:
- 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.

"@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.

@ematipico ematipico merged commit 66931a8 into main Feb 16, 2026
18 checks passed
@ematipico ematipico deleted the fix/GH-9081 branch February 16, 2026 15:29
@github-actions github-actions bot mentioned this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-CSS Language: CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 False positives for noUnknownPseudoElement after updating to 2.4.0

2 participants