stylelint-config-crisp 1.0.20 → 1.0.22
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
|
@@ -56,6 +56,7 @@ const ruleFunction = (primaryOption, secondaryOptions = {}, context) => {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// Third pass (check all class selectors)
|
|
59
60
|
root.walkRules(rule => {
|
|
60
61
|
// Skip rules without selectors (e.g. @font-face, @keyframes, variables)
|
|
61
62
|
if (!rule.selector) {
|
|
@@ -80,9 +81,16 @@ const ruleFunction = (primaryOption, secondaryOptions = {}, context) => {
|
|
|
80
81
|
|
|
81
82
|
if (!isInterpolated) {
|
|
82
83
|
// Skip classes elements outside of CSS file scope
|
|
83
|
-
if (
|
|
84
|
+
if (fileScopeClass) {
|
|
85
|
+
if (rule.selector.startsWith(".") &&
|
|
84
86
|
!rule.selector.startsWith(`.${fileScopeClass}`)) {
|
|
85
|
-
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (rule.selector.startsWith("&.") &&
|
|
91
|
+
!rule.selector.startsWith(`&.${fileScopeClass}`)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
if (context.fix) {
|