diff --git a/lib/run-compilation.js b/lib/run-compilation.js index 40858db..7abf4bc 100644 --- a/lib/run-compilation.js +++ b/lib/run-compilation.js @@ -24,6 +24,10 @@ module.exports = function runCompilation(options, compiler, done) { return f.errored; }); + if (!options.quiet) { + console.log(chalk.yellow(options.formatter(lint.results))); + } + if (options.failOnError && errors.length) { done(new Error('Failed because of a stylelint error.\n')); } else { diff --git a/test/fixtures/test10/index.js b/test/fixtures/test10/index.js new file mode 100644 index 0000000..055a358 --- /dev/null +++ b/test/fixtures/test10/index.js @@ -0,0 +1,3 @@ +require(getPath('./../../../node_modules/file-loader/index') + '!./test.scss'); + +console.log('test10'); diff --git a/test/fixtures/test10/test.scss b/test/fixtures/test10/test.scss new file mode 100644 index 0000000..7b074ee --- /dev/null +++ b/test/fixtures/test10/test.scss @@ -0,0 +1,4 @@ +html { + margin: 0 +;; +} diff --git a/test/index.js b/test/index.js index 6775283..80011fd 100644 --- a/test/index.js +++ b/test/index.js @@ -127,6 +127,24 @@ describe('stylelint-webpack-plugin', function () { }); }); + it('send messages to console when css file with errors and quiet props set to false', function () { + var config = { + context: './test/fixtures/test10', + entry: './index', + plugins: [ + new StyleLintPlugin({ + configFile: configFilePath + }) + ] + }; + + return pack(assign({}, baseConfig, config)) + .then(function (stats) { + expect(stats.compilation.warnings).to.have.length(1); + expect(stats.compilation.errors).to.have.length(1); + }); + }); + context('interop with NoErrorsPlugin', function () { it('works when failOnError is false', function () { var config = {