Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
stylelint-selector-bem-pattern
Advanced tools
A stylelint plugin that harnesses the power of postcss-bem-linter
A stylelint plugin that incorporates postcss-bem-linter.
To learn more about postcss-bem-linter, please read that module's documentation.
npm install stylelint-selector-bem-pattern
Add it to your stylelint config plugins
array, then add "plugin/selector-bem-pattern"
to your rules,
specifying your postcss-bem-linter settings as the primary option.
Even though postcss-bem-linter has the default setting of { preset: 'suit' }
, this plugin has
no default setting: if you want to use the SUIT preset, you must pass { preset: 'suit' }
,
and the rule will not work if you do not pass a primary option object.
Like so:
// .stylelintrc
{
"plugins": [
"stylelint-selector-bem-pattern"
],
"rules": {
// ...
"plugin/selector-bem-pattern": {
"componentName": "[A-Z]+",
"componentSelectors": {
"initial": "^\\.{componentName}(?:-[a-z]+)?$",
"combined": "^\\.combined-{componentName}-[a-z]+$"
},
"utilitySelectors": "^\\.util-[a-z]+$"
},
// ...
}
}
For more examples of postcss-bem-linter configuration possibilities, please read that module's documentation. Keep in mind that if your stylelint config is JSON you will have to use strings to specify your selector patterns (as above).
FAQs
A stylelint plugin that harnesses the power of postcss-bem-linter
The npm package stylelint-selector-bem-pattern receives a total of 96,192 weekly downloads. As such, stylelint-selector-bem-pattern popularity was classified as popular.
We found that stylelint-selector-bem-pattern demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.