Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested rules failing. #100

Open
brianmcallister opened this issue Dec 8, 2016 · 1 comment
Open

Nested rules failing. #100

brianmcallister opened this issue Dec 8, 2016 · 1 comment

Comments

@brianmcallister
Copy link

Little late to the party, but this doesn't appear to be working for me in v2.6.0. I am using stylelint-selector-bem-pattern, but I've installed 2.6.0 of this package specifically. If you think this is more of a problem with the stylelint plugin, I'd be happy to post this over there.

Here's my Sass file:

_test.scss

/* postcss-bem-linter: define test */
.test {
  &--red {
    color: rgba(255, 0 0);
  }

  .child {
    color: #ffffff;
  }
}

and here's my config:

module.exports = {
  plugins: [
    'stylelint-selector-bem-pattern'
  ],
  rules: {
    'plugin/selector-bem-pattern': {
      componentName: /[-a-z]+$/,
      componentSelectors: '^\\.{componentName}(?:[-_a-z]+)?$'
    },
  }
};

and my output:

src/stylesheets/modules/_test.scss
 7:3  ✖  Invalid component selector ".test .child"   plugin/selector-bem-pattern

Am I just doing something wrong? I started with a super simple regex for now, just to validate that this works.

@simonsmith
Copy link
Collaborator

Great, thanks. Might be related to #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants