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 selector-pseudo-*-allowed-list false positives for vendor prefixes #7525

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-hotels-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `selector-pseudo-*-allowed-list` false positives for vendor prefixes
4 changes: 4 additions & 0 deletions lib/rules/selector-pseudo-class-allowed-list/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const rule = (primary) => {

const name = value.slice(1);

if (matchesStringOrRegExp(name, primary)) {
return;
}

if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/rules/selector-pseudo-class-allowed-list/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const rule = (primary) => {

const name = value.slice(1);

if (matchesStringOrRegExp(name, primary)) {
return;
}

if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) {
return;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/rules/selector-pseudo-element-allowed-list/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ const rule = (primary) => {

const name = value.slice(2);

// Pseudo is in allowlist
if (matchesStringOrRegExp(name, primary)) {
return;
}

// Unprefixed-pseudo is in allowlist
if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) {
return;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/rules/selector-pseudo-element-allowed-list/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ const rule = (primary) => {

const name = value.slice(2);

// Pseudo is in allowlist
if (matchesStringOrRegExp(name, primary)) {
return;
}

// Unprefixed-pseudo is in allowlist
if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) {
return;
}
Expand Down