From 1053fa18e183411e14d3f4f630a866bfe2afdda1 Mon Sep 17 00:00:00 2001 From: wltsmrz Date: Tue, 23 Dec 2014 20:20:31 -0800 Subject: [PATCH] Add jshintrc --- Gulpfile.js | 38 +++++++++++++++++++++----------------- jshintrc | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 jshintrc diff --git a/Gulpfile.js b/Gulpfile.js index a1373681..592afd05 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -151,26 +151,30 @@ gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bowe gulp.task('lint', function() { gulp.src('src/js/ripple/*.js') - .pipe(jshint()) + .pipe(jshint('./jshintrc')) .pipe(map(function(file, callback) { - if (!file.jshint.success) { - console.log('\nIn', file.path); - - file.jshint.results.forEach(function(err) { - if (err && err.error) { - var col1 = err.error.line + ':' + err.error.character; - var col2 = '[' + err.error.reason + ']'; - var col3 = '(' + err.error.code + ')'; - - while (col1.length < 8) { - col1 += ' '; - } - - console.log(' ' + [ col1, col2, col3 ].join(' ')); - } - }); + if (file.jshint.success) { + return callback(null, file); } + console.log('\n>' + file.path.substring(file.base.length) + '\n'); + + file.jshint.results.forEach(function(err) { + if (err && err.error) { + var col1 = err.error.line + ':' + err.error.character; + var col2 = err.error.reason; + var col3 = '(' + err.error.code + ')'; + + while (col1.length < 8) { + col1 = ' ' + col1; + } + + col1 += ' |'; + + console.log([ col1, col2, col3 ].join(' ')); + } + }); + callback(null, file); })); }); diff --git a/jshintrc b/jshintrc new file mode 100644 index 00000000..cadd4fc7 --- /dev/null +++ b/jshintrc @@ -0,0 +1,22 @@ +{ + "browser": true, + "jquery": true, + "node": true, + "camelcase": false, + "eqeqeq": true, + "eqnull": true, + "latedef": true, + "newcap": true, + "quotmark": "single", + "undef": true, + "unused": true, + "curly": true, + "freeze": true, + "nonbsp": true, + "boss": true, + "laxbreak": true, + "maxparams": 4, + "maxdepth": 3, + "esnext": true, + "-W004": true +}