stylelint-plugin-defensive-css 0.6.0 → 0.7.0
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
|
@@ -33,13 +33,12 @@ let isLastStyleDeclaration = false;
|
|
|
33
33
|
let isWrappedInHoverAtRule = false;
|
|
34
34
|
|
|
35
35
|
function traverseParentRules(parent) {
|
|
36
|
-
console.log({ parent });
|
|
37
36
|
if (parent.parent.type === 'root') {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
if (parent.parent.type === 'atrule') {
|
|
42
|
-
if (parent.parent.params.includes('hover: hover')) {
|
|
41
|
+
if (parent.parent.params && parent.parent.params.includes('hover: hover')) {
|
|
43
42
|
isWrappedInHoverAtRule = true;
|
|
44
43
|
} else {
|
|
45
44
|
traverseParentRules(parent.parent);
|
|
@@ -64,7 +63,7 @@ const ruleFunction = (_, options) => {
|
|
|
64
63
|
if (options?.['accidental-hover']) {
|
|
65
64
|
const parent = decl.parent;
|
|
66
65
|
const selector = parent.selector;
|
|
67
|
-
const isHoverSelector = selector
|
|
66
|
+
const isHoverSelector = selector?.includes(':hover');
|
|
68
67
|
isWrappedInHoverAtRule = false;
|
|
69
68
|
|
|
70
69
|
if (isHoverSelector) {
|