stylelint-config-crisp 1.0.37 → 1.0.38

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-config-crisp",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "Custom Stylelint Rules for Crisp",
5
5
  "author": "Crisp IM SAS",
6
6
  "main": "index.js",
@@ -165,8 +165,18 @@ function isSelectorIgnored(rule, fileScopeClass) {
165
165
  }
166
166
 
167
167
  if (rule.selector.startsWith("&.")) {
168
- if (!rule.selector.startsWith(`&.${fileScopeClass}`)) {
169
- return true;
168
+ const classMatch = rule.selector.match(/^&\.([\w-]+)/);
169
+
170
+ if (classMatch) {
171
+ const className = classMatch[1];
172
+
173
+ if (
174
+ className !== fileScopeClass &&
175
+ !className.startsWith(`${fileScopeClass}__`) &&
176
+ !className.startsWith(`${fileScopeClass}--`)
177
+ ) {
178
+ return true;
179
+ }
170
180
  }
171
181
  }
172
182
  }