diff --git a/lib/lintSource.js b/lib/lintSource.js index 4484483164..d7fe3f0aca 100644 --- a/lib/lintSource.js +++ b/lib/lintSource.js @@ -167,6 +167,7 @@ function lintPostcssResult( postcssResult.stylelint = postcssResult.stylelint || {}; postcssResult.stylelint.ruleSeverities = {}; postcssResult.stylelint.customMessages = {}; + postcssResult.stylelint.stylelintError = false; postcssResult.stylelint.quiet = config.quiet; const postcssDoc = postcssResult.root; @@ -253,6 +254,6 @@ function createEmptyPostcssResult( } }, messages: [], - stylelint: { stylelintError: null } + stylelint: { stylelintError: false } }; } diff --git a/system-tests/002/__snapshots__/002.test.js.snap b/system-tests/002/__snapshots__/002.test.js.snap index 64025f8f4f..e0def88cc6 100644 --- a/system-tests/002/__snapshots__/002.test.js.snap +++ b/system-tests/002/__snapshots__/002.test.js.snap @@ -4,7 +4,7 @@ exports[`002 1`] = ` Array [ Object { "deprecations": Array [], - "errored": undefined, + "errored": false, "ignored": undefined, "invalidOptionWarnings": Array [], "parseErrors": Array [], diff --git a/system-tests/003/__snapshots__/003.test.js.snap b/system-tests/003/__snapshots__/003.test.js.snap index b02425d184..20a595dd47 100644 --- a/system-tests/003/__snapshots__/003.test.js.snap +++ b/system-tests/003/__snapshots__/003.test.js.snap @@ -4,7 +4,7 @@ exports[`003 1`] = ` Array [ Object { "deprecations": Array [], - "errored": undefined, + "errored": false, "ignored": undefined, "invalidOptionWarnings": Array [], "parseErrors": Array [], diff --git a/system-tests/ignoreFile/.stylelintignore b/system-tests/ignoreFile/.stylelintignore new file mode 100644 index 0000000000..6b0ef942d5 --- /dev/null +++ b/system-tests/ignoreFile/.stylelintignore @@ -0,0 +1 @@ +stylesheet.css diff --git a/system-tests/ignoreFile/__snapshots__/ignoreFile.test.js.snap b/system-tests/ignoreFile/__snapshots__/ignoreFile.test.js.snap new file mode 100644 index 0000000000..e9ba232cc1 --- /dev/null +++ b/system-tests/ignoreFile/__snapshots__/ignoreFile.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`005 1`] = ` +Object { + "errored": false, + "output": "[]", + "results": Array [], +} +`; diff --git a/system-tests/ignoreFile/config.json b/system-tests/ignoreFile/config.json new file mode 100644 index 0000000000..69ec56a465 --- /dev/null +++ b/system-tests/ignoreFile/config.json @@ -0,0 +1,5 @@ +{ + "rules": { + "comment-no-empty": true + } +} diff --git a/system-tests/ignoreFile/ignoreFile.test.js b/system-tests/ignoreFile/ignoreFile.test.js new file mode 100644 index 0000000000..cedf84867b --- /dev/null +++ b/system-tests/ignoreFile/ignoreFile.test.js @@ -0,0 +1,18 @@ +/* @flow */ +"use strict"; + +const stylelint = require("../../lib"); +const systemTestUtils = require("../systemTestUtils"); + +it("ignoreFile", () => { + return stylelint + .lint({ + files: [systemTestUtils.caseStylesheetGlob("ignoreFile")], + ignorePath: require("path").join(__dirname, ".stylelintignore"), + allowEmptyInput: true, + configFile: systemTestUtils.caseConfig("ignoreFile") + }) + .then(output => { + expect(output).toMatchSnapshot(); + }); +}, 10000); diff --git a/system-tests/ignoreFile/stylesheet.css b/system-tests/ignoreFile/stylesheet.css new file mode 100644 index 0000000000..45f5740719 --- /dev/null +++ b/system-tests/ignoreFile/stylesheet.css @@ -0,0 +1,3 @@ +a { + color: red /**/ +}