stylelint-scss
Advanced tools
Comparing version 4.0.1 to 4.1.0
@@ -32,2 +32,3 @@ "use strict"; | ||
var mapNamespace = (0, _utils.moduleNamespace)(root, "sass:map"); | ||
root.walkAtRules("each", function (rule) { | ||
@@ -41,3 +42,3 @@ var parts = separateEachParams(rule.params); // If loop is fetching both key + value, return | ||
if (!didCallMapKeys(parts[1])) { | ||
if (!didCallMapKeys(parts[1], mapNamespace)) { | ||
return; | ||
@@ -53,3 +54,3 @@ } // Loop over decls inside of each statement and loop for variable assignments. | ||
if (!didCallMapGet(innerDecl.value)) { | ||
if (!didCallMapGet(innerDecl.value, mapNamespace)) { | ||
return; | ||
@@ -59,5 +60,5 @@ } // Check map_name + key_name match. | ||
var map_get_parts = mapGetParameters(innerDecl.value); // Check map names match. | ||
var map_get_parts = mapGetParameters(innerDecl.value, mapNamespace); // Check map names match. | ||
if (map_get_parts[0] !== mapName(parts[1])) { | ||
if (map_get_parts[0] !== mapName(parts[1], mapNamespace)) { | ||
return; | ||
@@ -91,24 +92,32 @@ } // Match key names match. | ||
function didCallMapKeys(map_decl) { | ||
return map_decl.match(/map-keys\(.*\)/); | ||
function didCallMapKeys(mapDecl, mapNamespace) { | ||
var pattern = getNamespacedPattern("keys\\(.*\\)", mapNamespace); | ||
return new RegExp(pattern).test(mapDecl); | ||
} | ||
function didCallMapGet(map_decl) { | ||
return map_decl.match(/map-get\((.*),(.*)\)/); | ||
} // Fetch the name of the map from a map-keys() call. | ||
function didCallMapGet(mapDecl, mapNamespace) { | ||
var pattern = getNamespacedPattern("get\\((.*),(.*)\\)", mapNamespace); | ||
return new RegExp(pattern).test(mapDecl); | ||
} // Fetch the name of the map from a map-keys() or map.keys() call. | ||
function mapName(map_decl) { | ||
if (didCallMapKeys(map_decl)) { | ||
return map_decl.match(/map-keys\((.*)\)/)[1]; | ||
} else { | ||
return map_decl; | ||
function mapName(mapDecl, mapNamespace) { | ||
if (didCallMapKeys(mapDecl, mapNamespace)) { | ||
var pattern = getNamespacedPattern("keys\\((.*)\\)", mapNamespace); | ||
return mapDecl.match(new RegExp(pattern))[1]; | ||
} | ||
} // Returns the parameters of a map-get call | ||
return mapDecl; | ||
} // Returns the parameters of a map-get or map.get call | ||
// Returns [map variable, key_variable] | ||
function mapGetParameters(mapGetDecl) { | ||
var parts = mapGetDecl.match(/map-get\((.*), ?(.*)\)/); | ||
function mapGetParameters(mapGetDecl, mapNamespace) { | ||
var pattern = getNamespacedPattern("get\\((.*), ?(.*)\\)", mapNamespace); | ||
var parts = mapGetDecl.match(new RegExp(pattern)); | ||
return [parts[1], parts[2]]; | ||
} | ||
function getNamespacedPattern(pattern, namespace) { | ||
return namespace !== null ? "(?:".concat(namespace, "\\.|map-)").concat(pattern) : pattern; | ||
} |
@@ -52,2 +52,4 @@ "use strict"; | ||
var _atUseNoUnnamespaced = _interopRequireDefault(require("./at-use-no-unnamespaced")); | ||
var _commentNoEmpty = _interopRequireDefault(require("./comment-no-empty")); | ||
@@ -79,2 +81,4 @@ | ||
var _dollarVariableNoNamespacedAssignment = _interopRequireDefault(require("./dollar-variable-no-namespaced-assignment")); | ||
var _dollarVariablePattern = _interopRequireDefault(require("./dollar-variable-pattern")); | ||
@@ -147,2 +151,3 @@ | ||
"at-rule-no-unknown": _atRuleNoUnknown["default"], | ||
"at-use-no-unnamespaced": _atUseNoUnnamespaced["default"], | ||
"comment-no-empty": _commentNoEmpty["default"], | ||
@@ -161,2 +166,3 @@ "comment-no-loud": _commentNoLoud["default"], | ||
"dollar-variable-no-missing-interpolation": _dollarVariableNoMissingInterpolation["default"], | ||
"dollar-variable-no-namespaced-assignment": _dollarVariableNoNamespacedAssignment["default"], | ||
"dollar-variable-pattern": _dollarVariablePattern["default"], | ||
@@ -163,0 +169,0 @@ "double-slash-comment-empty-line-before": _doubleSlashCommentEmptyLineBefore["default"], |
@@ -132,2 +132,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "moduleNamespace", { | ||
enumerable: true, | ||
get: function get() { | ||
return _moduleNamespace.moduleNamespace; | ||
} | ||
}); | ||
Object.defineProperty(exports, "namespace", { | ||
@@ -248,2 +254,4 @@ enumerable: true, | ||
var _moduleNamespace = require("./moduleNamespace"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
{ | ||
"name": "stylelint-scss", | ||
"description": "A collection of SCSS specific rules for Stylelint", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"author": "Krister Kari", | ||
@@ -6,0 +6,0 @@ "babel": { |
@@ -59,3 +59,3 @@ # stylelint-scss | ||
- [`at-each-key-value-single-line`](./src/rules/at-each-key-value-single-line/README.md): This is a rule that checks for situations where users have done a loop using map-keys and grabbed the value for that key inside of the loop. | ||
- [`at-each-key-value-single-line`](./src/rules/at-each-key-value-single-line/README.md): This is a rule that checks for situations where users have done a loop using map-keys or map.keys and grabbed the value for that key inside of the loop. | ||
@@ -104,2 +104,6 @@ ### `@`-else | ||
### `@`-use | ||
- [`at-use-no-unnamespaced`](./src/rules/at-use-no-unnamespaced/README.md): Disallow `@use` without a namespace (i.e. `@use "..." as *`). | ||
### `$`-variable | ||
@@ -115,2 +119,3 @@ | ||
- [`dollar-variable-no-missing-interpolation`](./src/rules/dollar-variable-no-missing-interpolation/README.md): Disallow Sass variables that are used without interpolation with CSS features that use custom identifiers. | ||
- [`dollar-variable-no-namespaced-assignment`](./src/rules/dollar-variable-no-namespaced-assignment/README.md): Disallow assignment to namespaced Sass variables. | ||
- [`dollar-variable-pattern`](./src/rules/dollar-variable-pattern/README.md): Specify a pattern for Sass-like variables. | ||
@@ -226,5 +231,5 @@ | ||
<th align="center"><a href="https://github.com/srawlins"><img alt="srawlins" src="https://avatars.githubusercontent.com/u/103167?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/stof"><img alt="stof" src="https://avatars.githubusercontent.com/u/439401?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/pipopotamasu"><img alt="pipopotamasu" src="https://avatars.githubusercontent.com/u/14048211?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/ybiquitous"><img alt="ybiquitous" src="https://avatars.githubusercontent.com/u/473530?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/OriR"><img alt="OriR" src="https://avatars.githubusercontent.com/u/2384068?v=4&s=80" width="80"></a></th> | ||
</tr> | ||
@@ -236,5 +241,5 @@ </thead> | ||
<td align="center"><a href="https://github.com/srawlins">srawlins</a></td> | ||
<td align="center"><a href="https://github.com/stof">stof</a></td> | ||
<td align="center"><a href="https://github.com/pipopotamasu">pipopotamasu</a></td> | ||
<td align="center"><a href="https://github.com/ybiquitous">ybiquitous</a></td> | ||
<td align="center"><a href="https://github.com/OriR">OriR</a></td> | ||
</tr> | ||
@@ -245,2 +250,3 @@ </tbody></table> | ||
<tr> | ||
<th align="center"><a href="https://github.com/OriR"><img alt="OriR" src="https://avatars.githubusercontent.com/u/2384068?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/ntwb"><img alt="ntwb" src="https://avatars.githubusercontent.com/u/1016458?v=4&s=80" width="80"></a></th> | ||
@@ -251,6 +257,6 @@ <th align="center"><a href="https://github.com/ricardogobbosouza"><img alt="ricardogobbosouza" src="https://avatars.githubusercontent.com/u/13064722?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/kevindew"><img alt="kevindew" src="https://avatars.githubusercontent.com/u/282717?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/thibaudcolas"><img alt="thibaudcolas" src="https://avatars.githubusercontent.com/u/877585?v=4&s=80" width="80"></a></th> | ||
</tr> | ||
</thead> | ||
<tbody><tr> | ||
<td align="center"><a href="https://github.com/OriR">OriR</a></td> | ||
<td align="center"><a href="https://github.com/ntwb">ntwb</a></td> | ||
@@ -261,3 +267,2 @@ <td align="center"><a href="https://github.com/ricardogobbosouza">ricardogobbosouza</a></td> | ||
<td align="center"><a href="https://github.com/kevindew">kevindew</a></td> | ||
<td align="center"><a href="https://github.com/thibaudcolas">thibaudcolas</a></td> | ||
</tr> | ||
@@ -268,17 +273,17 @@ </tbody></table> | ||
<tr> | ||
<th align="center"><a href="https://github.com/thibaudcolas"><img alt="thibaudcolas" src="https://avatars.githubusercontent.com/u/877585?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/AndyOGo"><img alt="AndyOGo" src="https://avatars.githubusercontent.com/u/914443?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/chalkygames123"><img alt="chalkygames123" src="https://avatars.githubusercontent.com/u/5608239?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/xboy2012"><img alt="xboy2012" src="https://avatars.githubusercontent.com/u/7540144?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/alexander-akait"><img alt="alexander-akait" src="https://avatars.githubusercontent.com/u/4567934?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/vseventer"><img alt="vseventer" src="https://avatars.githubusercontent.com/u/638323?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/SterlingVix"><img alt="SterlingVix" src="https://avatars.githubusercontent.com/u/7531113?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/Calme1709"><img alt="Calme1709" src="https://avatars.githubusercontent.com/u/30140939?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/Deimos"><img alt="Deimos" src="https://avatars.githubusercontent.com/u/9033?v=4&s=80" width="80"></a></th> | ||
</tr> | ||
</thead> | ||
<tbody><tr> | ||
<td align="center"><a href="https://github.com/thibaudcolas">thibaudcolas</a></td> | ||
<td align="center"><a href="https://github.com/AndyOGo">AndyOGo</a></td> | ||
<td align="center"><a href="https://github.com/chalkygames123">chalkygames123</a></td> | ||
<td align="center"><a href="https://github.com/xboy2012">xboy2012</a></td> | ||
<td align="center"><a href="https://github.com/alexander-akait">alexander-akait</a></td> | ||
<td align="center"><a href="https://github.com/vseventer">vseventer</a></td> | ||
<td align="center"><a href="https://github.com/SterlingVix">SterlingVix</a></td> | ||
<td align="center"><a href="https://github.com/Calme1709">Calme1709</a></td> | ||
<td align="center"><a href="https://github.com/Deimos">Deimos</a></td> | ||
</tr> | ||
@@ -289,17 +294,17 @@ </tbody></table> | ||
<tr> | ||
<th align="center"><a href="https://github.com/SterlingVix"><img alt="SterlingVix" src="https://avatars.githubusercontent.com/u/7531113?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/Calme1709"><img alt="Calme1709" src="https://avatars.githubusercontent.com/u/30140939?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/Deimos"><img alt="Deimos" src="https://avatars.githubusercontent.com/u/9033?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/diego-codes"><img alt="diego-codes" src="https://avatars.githubusercontent.com/u/5973294?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/diego-codes"><img alt="diego-codes" src="https://avatars.githubusercontent.com/u/5973294?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/EvanHahn"><img alt="EvanHahn" src="https://avatars.githubusercontent.com/u/777712?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/guoyunhe"><img alt="guoyunhe" src="https://avatars.githubusercontent.com/u/5836790?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/jantimon"><img alt="jantimon" src="https://avatars.githubusercontent.com/u/4113649?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/stormwarning"><img alt="stormwarning" src="https://avatars.githubusercontent.com/u/999825?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/keegan-lillo"><img alt="keegan-lillo" src="https://avatars.githubusercontent.com/u/3537963?v=4&s=80" width="80"></a></th> | ||
</tr> | ||
</thead> | ||
<tbody><tr> | ||
<td align="center"><a href="https://github.com/SterlingVix">SterlingVix</a></td> | ||
<td align="center"><a href="https://github.com/Calme1709">Calme1709</a></td> | ||
<td align="center"><a href="https://github.com/Deimos">Deimos</a></td> | ||
<td align="center"><a href="https://github.com/diego-codes">diego-codes</a></td> | ||
<td align="center"><a href="https://github.com/diego-codes">diego-codes</a></td> | ||
<td align="center"><a href="https://github.com/EvanHahn">EvanHahn</a></td> | ||
<td align="center"><a href="https://github.com/guoyunhe">guoyunhe</a></td> | ||
<td align="center"><a href="https://github.com/jantimon">jantimon</a></td> | ||
<td align="center"><a href="https://github.com/stormwarning">stormwarning</a></td> | ||
<td align="center"><a href="https://github.com/keegan-lillo">keegan-lillo</a></td> | ||
</tr> | ||
@@ -310,17 +315,17 @@ </tbody></table> | ||
<tr> | ||
<th align="center"><a href="https://github.com/guoyunhe"><img alt="guoyunhe" src="https://avatars.githubusercontent.com/u/5836790?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/jantimon"><img alt="jantimon" src="https://avatars.githubusercontent.com/u/4113649?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/stormwarning"><img alt="stormwarning" src="https://avatars.githubusercontent.com/u/999825?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/keegan-lillo"><img alt="keegan-lillo" src="https://avatars.githubusercontent.com/u/3537963?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/manovotny"><img alt="manovotny" src="https://avatars.githubusercontent.com/u/446260?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/paulgv"><img alt="paulgv" src="https://avatars.githubusercontent.com/u/4895885?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/sajadtorkamani"><img alt="sajadtorkamani" src="https://avatars.githubusercontent.com/u/9380313?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/YozhikM"><img alt="YozhikM" src="https://avatars.githubusercontent.com/u/27273025?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/chalkygames123"><img alt="chalkygames123" src="https://avatars.githubusercontent.com/u/5608239?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/AM-77"><img alt="AM-77" src="https://avatars.githubusercontent.com/u/18232579?v=4&s=80" width="80"></a></th> | ||
</tr> | ||
</thead> | ||
<tbody><tr> | ||
<td align="center"><a href="https://github.com/guoyunhe">guoyunhe</a></td> | ||
<td align="center"><a href="https://github.com/jantimon">jantimon</a></td> | ||
<td align="center"><a href="https://github.com/stormwarning">stormwarning</a></td> | ||
<td align="center"><a href="https://github.com/keegan-lillo">keegan-lillo</a></td> | ||
<td align="center"><a href="https://github.com/manovotny">manovotny</a></td> | ||
<td align="center"><a href="https://github.com/paulgv">paulgv</a></td> | ||
<td align="center"><a href="https://github.com/sajadtorkamani">sajadtorkamani</a></td> | ||
<td align="center"><a href="https://github.com/YozhikM">YozhikM</a></td> | ||
<td align="center"><a href="https://github.com/chalkygames123">chalkygames123</a></td> | ||
<td align="center"><a href="https://github.com/AM-77">AM-77</a></td> | ||
</tr> | ||
@@ -331,2 +336,5 @@ </tbody></table> | ||
<tr> | ||
<th align="center"><a href="https://github.com/sajadtorkamani"><img alt="sajadtorkamani" src="https://avatars.githubusercontent.com/u/9380313?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/YozhikM"><img alt="YozhikM" src="https://avatars.githubusercontent.com/u/27273025?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/AM-77"><img alt="AM-77" src="https://avatars.githubusercontent.com/u/18232579?v=4&s=80" width="80"></a></th> | ||
<th align="center"><a href="https://github.com/YodaDaCoda"><img alt="YodaDaCoda" src="https://avatars.githubusercontent.com/u/365349?v=4&s=80" width="80"></a></th> | ||
@@ -337,2 +345,5 @@ <th align="center"><a href="https://github.com/freezy-sk"><img alt="freezy-sk" src="https://avatars.githubusercontent.com/u/661637?v=4&s=80" width="80"></a></th> | ||
<tbody><tr> | ||
<td align="center"><a href="https://github.com/sajadtorkamani">sajadtorkamani</a></td> | ||
<td align="center"><a href="https://github.com/YozhikM">YozhikM</a></td> | ||
<td align="center"><a href="https://github.com/AM-77">AM-77</a></td> | ||
<td align="center"><a href="https://github.com/YodaDaCoda">YodaDaCoda</a></td> | ||
@@ -339,0 +350,0 @@ <td align="center"><a href="https://github.com/freezy-sk">freezy-sk</a></td> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291235
104
6533
346