0

I am using grunt-postcss in my gruntfile.js and everything works fine except the postcss-bem-linter which should log warning in the console if the BEM rules are not followed. Here a snippet of configuration in gruntfile.js:

var preprocessorsAfterSprites = [
    require('postcss-bem-linter')(function (a) {
        console.log(a);
    }), // this just doesn't want to work right now
    require('postcss-reporter')
];

function getPostCssPreprocessors(name) {
    return preprocessorsAfterSprites;
}

grunt.initConfig({
    postcss: {
        options: {
            map: { inline: false }
        },
        golden: {
            src: '<%= dirs.pcss %>/golden/main.scss',
            dest: '<%= dirs.css %>/golden.css',
            options: {
                processors: getPostCssPreprocessors('golden')
            }
        }
    }
});

When I try to type grunt postcss:golden I dont have any output from the console log. Any ideas why?

Ruben Rizzi
  • 342
  • 1
  • 3
  • 20

1 Answers1

1

postcss-bem-linter does not accept a callback (https://github.com/postcss/postcss-bem-linter). So I don't know why you think that require('postcss-bem-linter')(function (a) { console.log(a); }) should work.

davidtheclark
  • 4,666
  • 6
  • 32
  • 42