postcss / postcss-bem-linter

A BEM linter for postcss
MIT License
572 stars 35 forks source link

Cannot ignore custom property name #74

Closed jgautheron closed 9 years ago

jgautheron commented 9 years ago

Custom component selectors can be ignored but custom property names cannot.

Quick example:

.Navigation {
  /* postcss-bem-linter: ignore */
  --paper-menu-selected-item: {
    color: #262626;
  };

  /* postcss-bem-linter: ignore */
  --paper-menu-background-color: #fff;
}

11:3 ⚠ Invalid custom property name "--paper-menu-background-color": a component's custom properties must start with the component name [postcss-bem-linter]

The first is properly ignored, the second is not. Is there any other way to ignore custom property names?

davidtheclark commented 9 years ago

No, there is no way to ignore a custom-property --- that's an oversight. Let's see if I can fix it now before breakfast ...

jgautheron commented 9 years ago

If you could make it work with ignoreSelectors that would be awesome, then I could simply use: ignoreSelectors: /^\-\-paper\-/ :dart:

davidtheclark commented 9 years ago

@jgautheron Please try the master branch and verify that it works. Should handle postcss-bem-linter: ignore above the declaration and an ignoreCustomProperties regexp. If master works for you, we'll release it.

jgautheron commented 9 years ago

It works fine, with both the inline ignore, and the ignoreCustomProperties. Thanks!

davidtheclark commented 9 years ago

@jgautheron Excellent. Will publish a new release in a second here.

davidtheclark commented 9 years ago

2.3.0

jgautheron commented 9 years ago

:+1: