Skip to content

Commit

Permalink
Fix keyframe-block-no-duplicate-selectors/`keyframe-declaration-no-…
Browse files Browse the repository at this point in the history
…important`/`keyframe-selector-notation`/`no-unknown-animations` false negatives for `@-o-keyframes` and `@-ms-keyframes` (#7953)
  • Loading branch information
Mouvedia authored Aug 26, 2024
1 parent 9744c18 commit 83e2851
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-wombats-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": minor
---

Fixed: `keyframe-block-no-duplicate-selectors`/`keyframe-declaration-no-important`/`keyframe-selector-notation`/`no-unknown-animations` false negatives for `@-o-keyframes` and `@-ms-keyframes`
2 changes: 1 addition & 1 deletion lib/rules/keyframe-block-no-duplicate-selectors/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const rule = (primary) => {
return;
}

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
const selectors = new Set();

atRuleKeyframes.walkRules((keyframeRule) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/keyframe-block-no-duplicate-selectors/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const rule = (primary) => {
return;
}

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
const selectors = new Set();

atRuleKeyframes.walkRules((keyframeRule) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/keyframe-declaration-no-important/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const rule = (primary) => {
return;
}

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
atRuleKeyframes.walkDecls((decl) => {
if (!decl.important) {
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/keyframe-declaration-no-important/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const rule = (primary) => {
return;
}

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
atRuleKeyframes.walkDecls((decl) => {
if (!decl.important) {
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/keyframe-selector-notation/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const rule = (primary) => {
},
});

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
const selectorsInBlock =
primary === 'percentage-unless-within-keyword-only-block'
? getSelectorsInBlock(atRuleKeyframes)
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/keyframe-selector-notation/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const rule = (primary) => {
},
});

root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
root.walkAtRules(/^(-(o|moz|ms|webkit)-)?keyframes$/i, (atRuleKeyframes) => {
const selectorsInBlock =
primary === 'percentage-unless-within-keyword-only-block'
? getSelectorsInBlock(atRuleKeyframes)
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-animations/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const rule = (primary) => {

const declaredAnimations = new Set();

root.walkAtRules(/(-(moz|webkit)-)?keyframes/i, (atRule) => {
root.walkAtRules(/(-(o|moz|ms|webkit)-)?keyframes/i, (atRule) => {
declaredAnimations.add(atRule.params);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-animations/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const rule = (primary) => {

const declaredAnimations = new Set();

root.walkAtRules(/(-(moz|webkit)-)?keyframes/i, (atRule) => {
root.walkAtRules(/(-(o|moz|ms|webkit)-)?keyframes/i, (atRule) => {
declaredAnimations.add(atRule.params);
});

Expand Down

0 comments on commit 83e2851

Please sign in to comment.