stylelint
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -0,1 +1,5 @@ | ||
# 3.2.2 | ||
* Fixed: `selector-no-type` ignores `nth-child` pseudo-classes and `@keyframes` selectors. | ||
# 3.2.1 | ||
@@ -2,0 +6,0 @@ |
@@ -69,3 +69,3 @@ "use strict"; | ||
if (!config.rules) { | ||
throw (0, _utils.configurationError)("No rules found within configuration"); | ||
throw (0, _utils.configurationError)("No rules found within configuration. Have you used the \"rules\" key?"); | ||
} | ||
@@ -72,0 +72,0 @@ |
@@ -16,7 +16,22 @@ "use strict"; | ||
root.walkRules(function (rule) { | ||
// Ignore keyframe selectors | ||
if (rule.parent.type === "atrule" && rule.parent.name === "keyframes") { | ||
return; | ||
} | ||
(0, _postcssSelectorParser2.default)(function (selectorAST) { | ||
selectorAST.eachTag(function (tag) { | ||
// postcss-selector-parser includes the arguments to nth-child() functions | ||
// as "tags", so we need to ignore them ourselves. | ||
// The fake-tag's "parent" is actually a selector node, whose parent | ||
// should be the :nth-child pseudo node. | ||
if (tag.parent.parent.type === "pseudo" && tag.parent.parent.value === ":nth-child") { | ||
return; | ||
} | ||
// & is not a type selector: it's used for nesting | ||
if (tag.value === "&") { | ||
return; | ||
} | ||
(0, _utils.report)({ | ||
@@ -23,0 +38,0 @@ message: messages.rejected, |
{ | ||
"name": "stylelint", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Modern CSS linter", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -38,3 +38,3 @@ import postcss from "postcss" | ||
if (!config.rules) { | ||
throw configurationError("No rules found within configuration") | ||
throw configurationError("No rules found within configuration. Have you used the \"rules\" key?") | ||
} | ||
@@ -41,0 +41,0 @@ |
@@ -20,5 +20,20 @@ import selectorParser from "postcss-selector-parser" | ||
root.walkRules(rule => { | ||
// Ignore keyframe selectors | ||
if (rule.parent.type === "atrule" && rule.parent.name === "keyframes") { | ||
return | ||
} | ||
selectorParser(selectorAST => { | ||
selectorAST.eachTag(tag => { | ||
// postcss-selector-parser includes the arguments to nth-child() functions | ||
// as "tags", so we need to ignore them ourselves. | ||
// The fake-tag's "parent" is actually a selector node, whose parent | ||
// should be the :nth-child pseudo node. | ||
if (tag.parent.parent.type === "pseudo" && tag.parent.parent.value === ":nth-child") { | ||
return | ||
} | ||
// & is not a type selector: it's used for nesting | ||
if (tag.value === "&") { return } | ||
report({ | ||
@@ -25,0 +40,0 @@ message: messages.rejected, |
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
636986
13814