diff --git a/CHANGELOG.md b/CHANGELOG.md index 29e4518..051980e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 3.0.1 (November XX, 2016) +* Fix: Setting `lint` to false also disables `postcss-bem-linter` * Allow config file to be arbitrarily named * Fix: `undefined` cli flags don't override config diff --git a/lib/index.js b/lib/index.js index da08051..5dce32b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -156,7 +156,9 @@ function lintFile(css, options, filename) { var processor = postcss(); if (options.lint) { - processor.use(stylelint(options.stylelint || stylelintConfigSuit)); + processor + .use(stylelint(options.stylelint || stylelintConfigSuit)) + .use(bemLinter(options['postcss-bem-linter'])); } // Merge filename alongside any other `postcss` options @@ -165,7 +167,6 @@ function lintFile(css, options, filename) { }); processor - .use(bemLinter(options['postcss-bem-linter'])) .use(reporter(options['postcss-reporter'])); if (isPromise(css)) { diff --git a/test/linting.js b/test/linting.js index 4e8b6eb..4756cde 100644 --- a/test/linting.js +++ b/test/linting.js @@ -79,3 +79,16 @@ describe('stylelint', function() { ).to.be.rejectedWith(Error, 'postcss-reporter: warnings or errors were found'); }); }); + +describe('disabling linting', function() { + it('should not run stylelint or postcss-bem-linter', function() { + return expect( + suitcss('/** @define Foo */\n\n.foo {color: red;}', { + lint: false, + 'postcss-reporter': { + throwError: true + } + }) + ).to.be.fulfilled; + }); +});