postcss / postcss-bem-linter

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

How to configure it inside a postcss.config.js #133

Closed tristanbes closed 5 years ago

tristanbes commented 6 years ago

Hello,

We're trying to cfg postcss-bem-linter inside a postcss.config.js but the documentation doesn't mention how to.

We've tried:

module.exports = {
  plugins: {
    autoprefixer: {
      browsers: ["> 1%", "last 1 version", "not dead"]
    },
    bemLinter("bem")
  }
};

Without success (expceted identifyer).

simonsmith commented 6 years ago

That code snippet looks invalid to me. Would you not follow the autoprefixer example above?

module.exports = {
  plugins: {
    autoprefixer: {
      browsers: ["> 1%", "last 1 version", "not dead"]
    },
    'postcss-bem-linter': { /* options */ }
  }
};

Documentation here - https://github.com/michael-ciniawsky/postcss-load-config

tristanbes commented 6 years ago

thanks for the hint.

I've put

module.exports = {
  plugins: {
    autoprefixer: {
      browsers: ["> 1%", "last 1 version", "not dead"]
    },
    'postcss-bem-linter': { preset: "bem" },
  }
};

At this point, I can't confirm it's working, but at least it doesn't give me a parsing error :S

simonsmith commented 5 years ago

Closing as no further discussion