postcss / postcss-bem-linter

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

README example doesn't work #51

Closed m-allanson closed 9 years ago

m-allanson commented 9 years ago

I couldn't get the example code in the readme to output any warnings.

To me it looks like the forEach block should be written like this:

paths.forEach(function (file) {
  var css = fs.readFileSync(file, 'utf-8');
  postcss()
    .use(bemLinter())
    .use(logWarnings())
    .process(css, {from: file})
    .then();
});

Is that correct?

I made a quick repo to test this out: https://github.com/m-allanson/postcss-bem-linter-demo

davidtheclark commented 9 years ago

Your change is the addition of .then() at the end, right?

That would make sense --- I don't think that part of the readme was updated since postcss changed its API to use then.

@ai Do you want to have examples like this that are using straight PostCSS, or would you rather that the plugin examples use a runner, like gulp-postcss, which is more likely what users will be using?

m-allanson commented 9 years ago

@davidtheclark Yep it's the addition of the .then().

Regarding examples, personally I'm using the CLI so find CLI examples useful. I understand I may be in the minority though :)

davidtheclark commented 9 years ago

Fixed in d3f1cedf7ee606a0dfa5c88fbf44368e92902f72