diff --git a/index.js b/index.js index f3671f2..d24365a 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ var formatter = require('stylelint/dist/formatters/stringFormatter').default; var runCompilation = require('./lib/run-compilation'); function apply(options, compiler) { + options = options || {}; var context = options.context || compiler.context; options = assign({ diff --git a/test/fixtures/test9/index.js b/test/fixtures/test9/index.js new file mode 100644 index 0000000..5b8bd0d --- /dev/null +++ b/test/fixtures/test9/index.js @@ -0,0 +1,3 @@ +require(getPath('./../../../node_modules/file-loader/index') + '!./test.scss'); + +console.log('test9'); diff --git a/test/fixtures/test9/test.scss b/test/fixtures/test9/test.scss new file mode 100644 index 0000000..b66215f --- /dev/null +++ b/test/fixtures/test9/test.scss @@ -0,0 +1,3 @@ +body { + display: block; +} diff --git a/test/index.js b/test/index.js index ada97f8..396f3b7 100644 --- a/test/index.js +++ b/test/index.js @@ -90,4 +90,20 @@ describe('stylelint-webpack-plugin', function () { expect(stats.compilation.warnings).to.have.length(1); }); }); + + it('works without StyleLintPlugin configuration but posts warnign .stylelintrc file not found', function () { + var config = { + context: './test/fixtures/test9', + entry: './index', + plugins: [ + new StyleLintPlugin() + ] + }; + + return pack(assign({}, baseConfig, config)) + .then(function (stats) { + expect(stats.compilation.errors).to.have.length(0); + expect(stats.compilation.warnings).to.have.length(0); + }); + }); });