postcss-bem-linter
Advanced tools
Comparing version 3.3.0 to 4.0.0
28
index.js
'use strict'; | ||
const postcss = require('postcss'); | ||
const validateCustomProperties = require('./lib/validate-custom-properties'); | ||
@@ -11,2 +10,3 @@ const validateUtilities = require('./lib/validate-utilities'); | ||
const checkImplicit = require('./lib/check-implicit'); | ||
const getComponentNameFromFilename = require('./lib/get-component-name-from-filename'); | ||
@@ -37,9 +37,9 @@ const DEFINE_VALUE = '([-_a-zA-Z0-9]+)\\s*(?:;\\s*(weak))?'; | ||
*/ | ||
module.exports = postcss.plugin( | ||
'postcss-bem-linter', | ||
(primaryOptions, secondaryOptions) => { | ||
const config = generateConfig(primaryOptions, secondaryOptions); | ||
const patterns = config.patterns; | ||
const plugin = (primaryOptions, secondaryOptions) => { | ||
const config = generateConfig(primaryOptions, secondaryOptions); | ||
const patterns = config.patterns; | ||
return (root, result) => { | ||
return { | ||
postcssPlugin: 'postcss-bem-linter', | ||
Once(root, {result}) { | ||
const ranges = findRanges(root); | ||
@@ -126,2 +126,4 @@ | ||
defined = path.basename(path.join(filename, '..')); | ||
} else { | ||
defined = getComponentNameFromFilename(defined, config); | ||
} | ||
@@ -134,5 +136,6 @@ | ||
result.warn( | ||
`Invalid component name from implicit conversion from filename ${filename}` | ||
`Invalid component name ${defined} from implicit conversion from filename ${filename}` | ||
); | ||
} | ||
ranges.push({ | ||
@@ -184,4 +187,7 @@ defined, | ||
} | ||
}; | ||
} | ||
); | ||
}, | ||
}; | ||
}; | ||
plugin.postcss = true; | ||
module.exports = plugin; |
{ | ||
"name": "postcss-bem-linter", | ||
"version": "3.3.0", | ||
"version": "4.0.0", | ||
"description": "A BEM linter for postcss", | ||
@@ -10,4 +10,3 @@ "files": [ | ||
"dependencies": { | ||
"minimatch": "^3.0.3", | ||
"postcss": "^7.0.14", | ||
"minimatch": "^3.1.2", | ||
"postcss-resolve-nested-selector": "^0.1.1" | ||
@@ -24,4 +23,8 @@ }, | ||
"jest": "^24.5.0", | ||
"prettier": "^1.11.1" | ||
"postcss": "^8.4.21", | ||
"prettier": "^1.13.7" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.4.21" | ||
}, | ||
"scripts": { | ||
@@ -28,0 +31,0 @@ "lint": "eslint lib test index.js", |
@@ -21,3 +21,3 @@ # postcss-bem-linter | ||
``` | ||
npm install postcss-bem-linter --save-dev | ||
npm install postcss postcss-bem-linter --save-dev | ||
``` | ||
@@ -24,0 +24,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
122820
602
37668
10
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.47(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removedpostcss@^7.0.14
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedminimatch@^3.1.2