postcss-bem-linter
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -0,1 +1,5 @@ | ||
=== 1.2.0 (October 12, 2015) | ||
* Support array of patterns for `ignoreSelectors`. | ||
=== 1.1.0 (September 18, 2015) | ||
@@ -2,0 +6,0 @@ |
var listSequences = require('./list-sequences'); | ||
var shouldIgnoreRule = require('./should-ignore-rule'); | ||
var shouldIgnoreSelector = require('./should-ignore-selector'); | ||
@@ -35,3 +36,3 @@ /** | ||
sequence = allSequences[i]; | ||
if (config.ignorePattern && config.ignorePattern.test(sequence)) continue; | ||
if (config.ignorePattern && shouldIgnoreSelector(sequence, config.ignorePattern)) continue; | ||
if (i === 0 && initialPattern.test(sequence)) continue; | ||
@@ -38,0 +39,0 @@ if (i !== 0 && combinedPattern.test(sequence)) continue; |
var listSequences = require('./list-sequences'); | ||
var shouldIgnoreRule = require('./should-ignore-rule'); | ||
var shouldIgnoreSelector = require('./should-ignore-selector'); | ||
@@ -19,3 +20,3 @@ /** | ||
sequence = allSequences[i]; | ||
if (config.ignorePattern && config.ignorePattern.test(sequence)) continue; | ||
if (config.ignorePattern && shouldIgnoreSelector(sequence, config.ignorePattern)) continue; | ||
if (config.utilityPattern.test(sequence)) continue; | ||
@@ -22,0 +23,0 @@ config.result.warn( |
{ | ||
"name": "postcss-bem-linter", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A BEM linter for postcss", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -99,4 +99,4 @@ # postcss-bem-linter | ||
if the stylesheet defines a group of utilities, as explained below. | ||
- `ignoreSelectors`: A regular expression describing selector sequences to ignore. You can use this to | ||
systematically ignore selectors matching this pattern, instead of having to add a | ||
- `ignoreSelectors`: A regular expression or an array of regular expressions describing selector sequences to ignore. You can use this to | ||
systematically ignore selectors matching certain patterns, instead of having to add a | ||
`/* postcss-bem-linter: ignore */` comment above each one (see below). | ||
@@ -159,3 +159,13 @@ | ||
ignoreSelectors: /\.no-.+/ | ||
}) | ||
}); | ||
// using an array for `ignoreSelectors` | ||
bemLinter({ | ||
preset: 'bem', | ||
componentName: /cmpnt_[a-zA-Z]+/, | ||
ignoreSelectors: [ | ||
/\.no-.+/, | ||
/\.isok-.+/ | ||
] | ||
}); | ||
``` | ||
@@ -270,3 +280,3 @@ | ||
As describe above, you can include an `ignoreSelectors` regular expression in your configuration. | ||
As describe above, you can include an `ignoreSelectors` regular expression (or array of regular expressions) in your configuration. | ||
This is the best approach if you want to systematically ignore all selectors matching a pattern (e.g. all Modernizr classes). | ||
@@ -273,0 +283,0 @@ |
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
25936
13
321
340