Socket
Socket
Sign inDemoInstall

stylelint

Package Overview
Dependencies
Maintainers
3
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

4

CHANGELOG.md

@@ -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 @@

2

dist/postcssPlugin.js

@@ -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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc