Skip to content

Commit 1154917

Browse files
iudelsmannsindresorhus
authored andcommittedJun 9, 2018
Add failOnError option (#154)
1 parent 1d97ae7 commit 1154917

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎readme.md

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ Default: `-1` *(means no limit)*
9393

9494
Number of warnings to trigger non-zero exit code.
9595

96+
### failOnError
97+
98+
Type: `boolean`<br>
99+
Default: `true`
100+
101+
Fail the build if ESLint found any errors.
102+
96103

97104
## License
98105

‎tasks/eslint.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = grunt => {
77
const opts = this.options({
88
outputFile: false,
99
quiet: false,
10-
maxWarnings: -1
10+
maxWarnings: -1,
11+
failOnError: true,
1112
});
1213

1314
if (this.filesSrc.length === 0) {
@@ -56,6 +57,6 @@ module.exports = grunt => {
5657
grunt.warn(`ESLint found too many warnings (maximum: ${opts.maxWarnings})`);
5758
}
5859

59-
return report.errorCount === 0;
60+
return opts.failOnError ? report.errorCount === 0 : 0;
6061
});
6162
};

0 commit comments

Comments
 (0)
Please sign in to comment.