From f92f8942fa263b1a8e949a5f2146b209428b077c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 3 Mar 2014 11:33:03 +0200 Subject: [PATCH] Grunt: Add JSHint support. --- Gruntfile.js | 20 ++++++++++++++++++-- js/.jshintrc | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 js/.jshintrc diff --git a/Gruntfile.js b/Gruntfile.js index 650be31..8f9677d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,7 @@ * http://opensource.org/licenses/MIT * ---------------------------------- */ +/* jshint node: true */ module.exports = function(grunt) { 'use strict'; @@ -148,6 +149,21 @@ module.exports = function(grunt) { docs: {} }, + jshint: { + options: { + jshintrc: 'js/.jshintrc' + }, + grunt: { + src: 'Gruntfile.js' + }, + src: { + src: 'js/*.js' + }, + docs: { + src: ['docs/assets/js/docs.js', 'docs/assets/js/fingerblast.js'] + } + }, + validation: { options: { charset: 'utf-8', @@ -186,9 +202,9 @@ module.exports = function(grunt) { grunt.registerTask('dist-js', ['concat', 'uglify']); grunt.registerTask('dist', ['dist-css', 'dist-js', 'copy']); grunt.registerTask('validate-html', ['jekyll', 'validation']); - grunt.registerTask('default', ['dist']); grunt.registerTask('build', ['dist']); - grunt.registerTask('test', ['dist', 'validate-html']); + grunt.registerTask('default', ['dist']); + grunt.registerTask('test', ['dist', 'jshint', 'validate-html']); // Version numbering task. // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z diff --git a/js/.jshintrc b/js/.jshintrc new file mode 100644 index 0000000..bf4f59a --- /dev/null +++ b/js/.jshintrc @@ -0,0 +1,18 @@ +{ + "boss" : true, + "browser" : true, + "camelcase" : true, + "devel" : true, + "eqeqeq" : true, + "eqnull" : true, + "expr" : true, + "indent" : 2, + "laxbreak" : true, + "nonbsp" : true, + "quotmark" : "single", + "strict" : true, + "trailing" : true, + "undef" : true, + "unused" : true, + "validthis" : true +}