Skip to content

Latest commit

 

History

History
131 lines (88 loc) · 1.94 KB

configuration-file.md

File metadata and controls

131 lines (88 loc) · 1.94 KB

Configuration file

sources

To define the paths of your source files.

{
  "sources": [
    "a/path/to/your/scss/*.scss",
    "a/path/to/a/specific/scss/main.scss
  ]
}

excludePath (option)

To define the paths of some exclude source files.

default: []

{
  "excludePath": [
    "an/exclude/path/of/scss/*.scss"
  ]
}

excludeBlock (option)

To define the names of some block that are not isolated yet, so the linter will be kind ;)

default: []

{
  "excludeBlock": [
    "messed-up-component",
    "disorder-file",
    "old-component"
  ]
}

snapshot (option)

A boolean if you want to monitor the quality tendency instead of targeting absolutely zero error.

ℹ️ You also can set a file path of your snapshot. The default path to store your snapshot is .bemlinter-snap.

ℹ️ If you use bemlinter with in command line, you can force snapshot update with -u.

default: false

{
  "snapshot": true
}

checkLowerCase (option)

To disable lower case check.

default: true

{
  "checkLowerCase": false
}

classPrefix (option)

To set the class prefix.

default: ''

{
  "classPrefix": "c-"
}

filePattern (option)

Regexp used to retrieve the block name from the file name.

⚠️ Your regexp should contain only one capturing group.

⚠️ You have to escape backslashes to keep your JSON valid.

default: '([^.]*)\.s?css'

{
  "filePattern": "(?:module-)?([^.]*)\\.scss"
}

modules (option)

Allow to override global option for portions of your sources.

⚠️ A module should have, at least name and sources properties.

default: []

{
  "modules": [
    {
      "name": "my-module",
      "sources": [
        "a/path/to/your/module/folder/*.scss",
        "a/path/to/a/module/file.scss"
      ],
      "classPrefix": "mm-",
      "filePattern": "my-module-([^.]*)\\.scss"
    }
  ]
}