2

In gruntfile

stylelint: {
    all: ['app/styles/**/*.scss']
},

.stylelintrc

{
    "plugins": [
        "stylelint-selector-bem-pattern"
    ],
    "rules": {
      "plugin/selector-bem-pattern": {
      "componentName": "[A-Z]+",
      "componentSelectors": {
        "initial": "^\\.{componentName}(?:-[a-z]+)?$",
        "combined": "^\\.combined-{componentName}-[a-z]+$"
      },
      "utilitySelectors": "^\\.util-[a-z]+$"
    }
    }
}

/Users/jitendravyas/app-test/styles/components/_campaign-settings-integrations.scss

/* @define campaign-settings */

.campaign-settings__integrations {
  @include flex;
}

.campaign-settings__integration {
  border: 1px solid $color-green;
  border-radius: 3px;
  color: $color-green;
  margin-right: $base-spacing-unit;
  @include flex;

  .check {
    background: $color-green;
    color: white;
    @include vertical-center;
  }

  > div {
    padding: $half-spacing-unit;
  }
}

Not getting any error when I run stylelint. Stylelint is working with other rules.

Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852

1 Answers1

5

I believe you have incorrectly defined your component name. As such, the linter is correctly skipping over the file.

You must use either a concise or verbose syntax:

/** @define campaign-settings */

or

/* postcss-bem-linter: define campaign-settings */

At the moment you appear to use an invalid form of the concise syntax i.e. your comment begins with /*, rather than /**.

jeddy3
  • 3,451
  • 1
  • 12
  • 21