Socket
Socket
Sign inDemoInstall

postcss-bem-linter

Package Overview
Dependencies
1
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.2.0

6

CHANGELOG.md

@@ -1,3 +0,7 @@

=== Head
=== 2.2.0 (November 15, 2015)
* Allow attribute selectors in BEM preset pattern.
* Fix bug causing pseudo-classes with operators like `:nth-child(3n+1)` to cause problems.
* Add flexibility (remove unnecessary strictness) in attribute part of preset patterns.
=== 2.1.0 (October 31, 2015)

@@ -4,0 +8,0 @@

6

lib/list-sequences.js

@@ -15,10 +15,8 @@ /**

module.exports = function(selector) {
return selector
var withoutPseudos = selector.split(':')[0];
return withoutPseudos
.split(/[\s>+~]/)
.filter(function(s) {
return s !== '';
})
.map(function(s) {
return s.split(':')[0];
});
}

@@ -21,11 +21,12 @@ module.exports = {

var ns = (presetOptions && presetOptions.namespace) ? presetOptions.namespace + '-' : '';
var OPTIONAL_PART = '(?:-[a-z0-9][a-zA-Z0-9]*)?';
var OPTIONAL_MODIFIER = '(?:--[a-z0-9][a-zA-Z0-9]*)?';
var OPTIONAL_ATTRIBUTE = '(?:\\[\\S+\\])?';
var OPTIONAL_STATE = '(?:\\.is-[a-z0-9][a-zA-Z0-9]*)?';
var OPTIONAL = OPTIONAL_PART +
OPTIONAL_MODIFIER +
OPTIONAL_ATTRIBUTE +
OPTIONAL_STATE;
return new RegExp('^\\.' + ns + componentName + '\\b' + OPTIONAL + '$');
var WORD = '[a-z0-9][a-zA-Z0-9]*';
var descendant = '(?:-' + WORD + ')?';
var modifier = '(?:--' + WORD + ')?';
var attribute = '(?:\\[.+\\])?';
var state = '(?:\\.is-' + WORD + ')?';
var body = descendant +
modifier +
attribute +
state;
return new RegExp('^\\.' + ns + componentName + '\\b' + body + '$');
}

@@ -44,3 +45,4 @@

var modifier = '(?:_' + WORD + '){0,2}';
return new RegExp('^\\.' + ns + block + element + modifier + '$');
var attribute = '(?:\\[.+\\])?';
return new RegExp('^\\.' + ns + block + element + modifier + attribute + '$');
}
{
"name": "postcss-bem-linter",
"version": "2.1.0",
"version": "2.2.0",
"description": "A BEM linter for postcss",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc