Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. BEM
  3. PostCSS BEM Linter

PostCSS BEM Linter

MITJavaScript3.1.0

A PostCSS plugin that lints CSS to ensure it follows BEM or SUIT naming conventions.

GitHubGitHub
576 stars33 forks0 contributors

What is PostCSS BEM Linter?

postcss-bem-linter is a PostCSS plugin that validates CSS selectors against BEM-style naming conventions. It helps maintain consistent and scalable CSS architecture by enforcing strict class naming patterns, preventing deviations that can lead to maintainability issues.

Target Audience

Frontend developers and teams using CSS methodologies like BEM or SUIT, particularly those working on large-scale projects where consistent CSS architecture is critical.

Value Proposition

Developers choose this plugin for its focused validation of selector conformance, leaving other linting concerns to dedicated tools like stylelint, and for its flexibility with custom pattern definitions and presets for popular methodologies.

Overview

A BEM linter for postcss

Use Cases

Best For

  • Enforcing BEM naming conventions in CSS to ensure consistency across a codebase.
  • Validating SUIT CSS methodology compliance in component-based projects.
  • Defining and enforcing custom CSS naming patterns using regular expressions.
  • Linting CSS in large-scale applications where maintainable architecture is a priority.
  • Integrating BEM/SUIT validation into existing PostCSS build pipelines.
  • Systematically ignoring specific selectors or custom properties via configuration or inline comments.

Not Ideal For

  • Projects using CSS-in-JS libraries like styled-components, where CSS is scoped and naming conventions are less relevant.
  • Teams adopting utility-first frameworks such as Tailwind CSS, which rely on pre-defined utility classes.
  • Small or rapid-prototyping projects where enforcing strict CSS naming rules adds unnecessary overhead.
  • Codebases not following any structured CSS methodology, making the plugin's validation irrelevant.

Pros & Cons

Pros

Focused BEM Validation

Enforces strict naming conventions for BEM and SUIT with preset patterns, ensuring consistent and scalable CSS architecture as highlighted in the README's support for popular methodologies.

Flexible Custom Patterns

Allows defining custom naming conventions using regex or functions, enabling teams to tailor linting to their specific needs, as shown in the configuration examples for component names and selectors.

Weak Mode Flexibility

Provides a weak mode where only initial selector sequences must match conventions, offering a balance between strictness and flexibility for complex selectors, detailed in the conformance tests section.

PostCSS Integration

Seamlessly integrates into PostCSS build pipelines, compatible with tools like gulp-postcss and postcss-reporter for easy setup, as mentioned in the installation and use sections.

Cons

Complex Configuration

Setting up custom patterns requires regex expertise and careful definition, which can be error-prone and time-consuming, as evidenced by the detailed regex examples and multiple configuration options in the README.

Limited Linting Scope

Only validates selector conformance, leaving other CSS aspects like properties or values to additional tools like stylelint, requiring a multi-tool setup for comprehensive linting, as stated in the philosophy.

Preprocessor Compatibility Issues

May have problems with CSS preprocessors like Sass or Less, especially with concatenated files, necessitating workarounds like special comments, as noted in the multiple definitions section referencing issue #57.

Frequently Asked Questions

Quick Stats

Stars576
Forks33
Contributors0
Open Issues18
Last commit2 years ago
CreatedSince 2014

Tags

#css-linting#linter#suit-css#frontend-tooling#code-quality#postcss#postcss-plugin#bem-methodology#bem#css-architecture

Built With

J
JavaScript
N
Node.js
P
PostCSS

Included in

BEM496
Auto-fetched 9 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub