Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-bem-linter

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-bem-linter

A BEM linter for postcss

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is postcss-bem-linter?

The postcss-bem-linter package is a PostCSS plugin that helps enforce BEM (Block Element Modifier) conventions in your CSS. It ensures that your CSS follows a consistent naming pattern, which can help maintainability and readability in larger projects.

What are postcss-bem-linter's main functionalities?

Enforce BEM Naming Conventions

This feature allows you to enforce BEM naming conventions in your CSS. By specifying 'bem' as the argument, the linter will check your CSS classes to ensure they follow the BEM methodology.

module.exports = {
  plugins: [
    require('postcss-bem-linter')('bem')
  ]
};

Custom Naming Conventions

This feature allows you to define custom naming conventions. In this example, the linter is configured to use the 'suit' preset and custom regular expressions for component names and selectors.

module.exports = {
  plugins: [
    require('postcss-bem-linter')({
      preset: 'suit',
      componentName: /^[A-Z][a-zA-Z0-9]+$/,
      componentSelectors: function(componentName) {
        return new RegExp('^\.' + componentName + '(?:-[a-zA-Z0-9]+)?$');
      }
    })
  ]
};

Ignore Specific Files or Directories

This feature allows you to ignore specific files or directories from being linted. In this example, any CSS files in the 'vendor' directory will be ignored by the linter.

module.exports = {
  plugins: [
    require('postcss-bem-linter')('bem', {
      ignoreFiles: ['**/vendor/**/*.css']
    })
  ]
};

Other packages similar to postcss-bem-linter

Keywords

FAQs

Package last updated on 11 Oct 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc