Skip to content

BedrockStreaming/bemlinter

Repository files navigation

bemlinter Build Status

A cli tool to lint bem component isolation in CSS / SCSS files.

The main rules are:

  1. A CSS block file should only contain its own classes
  2. A CSS file, even if it is not a block, should not style a class of another block

Quick start

npm i bemlinter --save

You can set your package.json to use bemlinter:

{
  "scripts": {
    "lint": "bemlinter lint the/path/to/your/*.scss"
  }
}

Configuration file

You will soon need more configuration, so you should use a json configuration file:

{
  "scripts": {
    "lint": "bemlinter lint --config bemlinter.json"
  }
}

The configuration allow you to define:

  • sources: the paths of your source files.
  • excludePath (option): the paths of some exclude source files.
  • excludeBlock (option): the names of some block that are not isolated yet.
  • snapshot (option): the activation of quality tendency.
  • checkLowerCase (option): the deactivation of lower case check.
  • classPrefix (option): the class prefix.
  • filePattern (option): the file pattern.
  • modules (option): the configuration override for portions of your sources.

How to Contribute

  1. Star the project!
  2. Report a bug that you have found.
  3. Tweet or blog about bemlinter and let us know about it.
  4. Pull requests are also highly appreciated.

Author & Community

bemlinter is under MIT License.
It was created & is maintained by Thomas ZILLIOX for M6Web.

About

A cli tool to lint bem component isolation in CSS / SCSS files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published