Skip to content

Commit

Permalink
MDL-68323 core: add --max-lint-warnings option to grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Apr 2, 2020
1 parent 604b2a3 commit e3e5bdf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ module.exports = function(grunt) {
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
options: {quiet: !grunt.option('show-lint-warnings')},
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
amd: {src: amdSrc},
// Check YUI module source files.
yui: {src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js']}
Expand Down

0 comments on commit e3e5bdf

Please sign in to comment.