stylelint-plugin-defensive-css 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-plugin-defensive-css",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A Stylelint plugin to enforce defensive CSS best practices.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -76,6 +76,11 @@ const ruleFunction = (_, options) => {
76
76
  const isHoverSelector = selector?.includes(':hover');
77
77
  isWrappedInHoverAtRule = false;
78
78
 
79
+ // If the :hover selector is inside a :not() selector, ignore it
80
+ if (/:not\(([^)]*:hover[^)]*)\)/g.test(selector)) {
81
+ return;
82
+ }
83
+
79
84
  if (isHoverSelector) {
80
85
  traverseParentRules(parent);
81
86