Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
postcss-bem-linter
Advanced tools
A PostCSS plugin to lint BEM-style CSS, ported from rework-suit-conformance Currently only supports the SUIT CSS methodology.
npm install postcss-bem-linter
Default mode:
ComponentName
.ComponentName
.:root
selector can only contain custom-properties.:root
cannot be combined with other selectors.Strict mode:
The plugin will only run against files that explicitly define themselves as a
named component, using a /** @define ComponentName */
or /** @define ComponentName; use strict */
comment on the first line of the file.
/** @define MyComponent */
:root {
--MyComponent-property: value;
}
.MyComponent {}
.MyComponent .other {}
Strict mode:
/** @define MyComponent; use strict */
:root {
--MyComponent-property: value;
}
.MyComponent {}
.MyComponent-other {}
Pass your individual CSS files through the plugin. It will throw errors for conformance failures, which you can log when caught by your build tools.
var postcss = require('postcss');
var bemLinter = require('postcss-bem-linter');
files.forEach(function (file) {
var css = fs.readFileSync(file, 'utf-8');
postcss().use(bemLinter).process(css);
});
Install the dependencies.
npm install
Run the tests.
npm test
Watch and automatically re-run the unit tests.
npm start
0.1.1 (November 22, 2014)
@keyframes
rules when validating selectors.FAQs
A BEM linter for postcss
The npm package postcss-bem-linter receives a total of 102,702 weekly downloads. As such, postcss-bem-linter popularity was classified as popular.
We found that postcss-bem-linter demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.