Skip to content

Commit

Permalink
always returns boolean stylelintError
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Jul 26, 2019
1 parent 1178f2d commit 391789c
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/lintSource.js
Expand Up @@ -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;
Expand Down Expand Up @@ -253,6 +254,6 @@ function createEmptyPostcssResult(
}
},
messages: [],
stylelint: { stylelintError: null }
stylelint: { stylelintError: false }
};
}
2 changes: 1 addition & 1 deletion system-tests/002/__snapshots__/002.test.js.snap
Expand Up @@ -4,7 +4,7 @@ exports[`002 1`] = `
Array [
Object {
"deprecations": Array [],
"errored": undefined,
"errored": false,
"ignored": undefined,
"invalidOptionWarnings": Array [],
"parseErrors": Array [],
Expand Down
2 changes: 1 addition & 1 deletion system-tests/003/__snapshots__/003.test.js.snap
Expand Up @@ -4,7 +4,7 @@ exports[`003 1`] = `
Array [
Object {
"deprecations": Array [],
"errored": undefined,
"errored": false,
"ignored": undefined,
"invalidOptionWarnings": Array [],
"parseErrors": Array [],
Expand Down
1 change: 1 addition & 0 deletions system-tests/ignoreFile/.stylelintignore
@@ -0,0 +1 @@
stylesheet.css
9 changes: 9 additions & 0 deletions 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 [],
}
`;
5 changes: 5 additions & 0 deletions system-tests/ignoreFile/config.json
@@ -0,0 +1,5 @@
{
"rules": {
"comment-no-empty": true
}
}
18 changes: 18 additions & 0 deletions 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);
3 changes: 3 additions & 0 deletions system-tests/ignoreFile/stylesheet.css
@@ -0,0 +1,3 @@
a {
color: red /**/
}

0 comments on commit 391789c

Please sign in to comment.