Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@namics/stylelint-bem
Advanced tools
Verifies that the given css/less/scss follows the following BEM code conventions.
npm install @namics/stylelint-bem --save-dev
{
"plugins": [
"@namics/stylelint-bem"
],
"rules": {
"plugin/stylelint-bem-namics": true
}
}
You can define one or more namespaces which has to be prepended before every class name:
{
"plugins": [
"@namics/stylelint-bem"
],
"rules": {
"plugin/stylelint-bem-namics": {
"namespaces": ["ux-"]
}
}
}
and in case of emergency you can overwrite the default prefixes
{
"plugins": [
"@namics/stylelint-bem"
],
"rules": {
"plugin/stylelint-bem-namics": {
"patternPrefixes": [ "a", "m", "o", "t", "p" ],
"helperPrefixes": [ "is", "has" ]
}
}
}
... or you can pass empty prefixes to disable prefixes completely
{
"plugins": [
"@namics/stylelint-bem"
],
"rules": {
"plugin/stylelint-bem-namics": {
"patternPrefixes": [],
"helperPrefixes": []
}
}
}
a
Atomm
Moleculeo
Organisml
Layoutg
Gridh
Helperstate
State.a-[block-name] {}
.m-[block-name] {}
.o-[block-name] {}
.l-[block-name] {}
.g-[block-name] {}
.h-[block-name] {}
.a-[block-name]--[modifier-name] {}
.m-[block-name]--[modifier-name] {}
.o-[block-name]--[modifier-name] {}
.l-[block-name]--[modifier-name] {}
.g-[block-name]--[modifier-name] {}
.h-[block-name]--[modifier-name] {}
.a-[block-name]__[element-name] {}
.m-[block-name]__[element-name] {}
.o-[block-name]__[element-name] {}
.l-[block-name]__[element-name] {}
.g-[block-name]__[element-name] {}
.h-[block-name]__[element-name] {}
.a-[block-name]__[element-name]__[element-name] {}
.m-[block-name]__[element-name]__[element-name] {}
.o-[block-name]__[element-name]__[element-name] {}
.l-[block-name]__[element-name]__[element-name] {}
.g-[block-name]__[element-name]__[element-name] {}
.h-[block-name]__[element-name]__[element-name] {}
.state-a-[block-name]--[state-name] {}
.state-m-[block-name]--[state-name] {}
.state-o-[block-name]--[state-name] {}
.state-l-[block-name]--[state-name] {}
.state-g-[block-name]--[state-name] {}
.state-h-[block-name]--[state-name] {}
Whenever you will apply rules you will run into edge cases like third-party code or wysiwyg content where those rules have to be bent a little bit.
In this case you can get around the rules above but you should leave a comment why and enable the linting again:
/* wysiwyg does not follow bem */
/* stylelint-disable plugin/stylelint-bem-namics */
.wysiwyg .headline {
font-size: 34px;
}
/* stylelint-enable plugin/stylelint-bem-namics */
Please see the CHANGELOG.md
FAQs
A stylelint plugin for the Namics BEM definitions
The npm package @namics/stylelint-bem receives a total of 3,258 weekly downloads. As such, @namics/stylelint-bem popularity was classified as popular.
We found that @namics/stylelint-bem demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.