stylelint-plugin-defensive-css 1.0.0-beta.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/README.md CHANGED
@@ -8,6 +8,12 @@ A Stylelint plugin to enforce defensive CSS best practices.
8
8
 
9
9
  > [Read more about Defensive CSS](https://defensivecss.dev/)
10
10
 
11
+ ## 🚀 Version 1.0.0
12
+
13
+ With the release of version 1.0.0 of the plugin, we now support Stylelint 16.
14
+
15
+ ---
16
+
11
17
  ## Getting Started
12
18
 
13
19
  > Before getting started with the plugin, you must first have
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-plugin-defensive-css",
3
- "version": "1.0.0-beta.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