Socket
Socket
Sign inDemoInstall

postcss-bem-linter

Package Overview
Dependencies
9
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.0 to 4.0.0

lib/get-component-name-from-filename.js

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

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