From 91aba3905030645decae313dd84a20b8eddd7ba5 Mon Sep 17 00:00:00 2001 From: devlinjd Date: Wed, 9 Dec 2015 21:44:18 -0500 Subject: [PATCH] Add file LINTing through JSHint. --- Gruntfile.js | 27 ++++++++++++++++++--------- package.json | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 90941b6..fd9987b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,7 +1,7 @@ -'use strict'; - module.exports = function (grunt) { + 'use strict'; + var opts = { pkg: grunt.file.readJSON('package.json'), @@ -29,19 +29,28 @@ module.exports = function (grunt) { outdir: 'docs/' } } + }, + + jshint: { + options: { + laxcomma: true, + expr: true + }, + all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'] } }; grunt.initConfig( opts ); + grunt.loadNpmTasks('grunt-simple-mocha'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.registerTask('test', 'Test the FluentCV library.', function( config ) { - grunt.task.run( ['simplemocha:all'] ); - }); - grunt.registerTask('document', 'Generate FluentCV library documentation.', function( config ) { - grunt.task.run( ['yuidoc'] ); - }); - grunt.registerTask('default', [ 'test', 'yuidoc' ]); + grunt.loadNpmTasks('grunt-contrib-jshint'); + + grunt.registerTask('test', 'Test the FluentCV library.', + function( config ) { grunt.task.run( ['simplemocha:all'] ); }); + grunt.registerTask('document', 'Generate FluentCV library documentation.', + function( config ) { grunt.task.run( ['yuidoc'] ); }); + grunt.registerTask('default', [ 'jshint', 'test', 'yuidoc' ]); }; diff --git a/package.json b/package.json index 7932fe8..59b76ec 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "devDependencies": { "chai": "*", "grunt": "*", + "grunt-contrib-jshint": "^0.11.3", "grunt-contrib-yuidoc": "^0.10.0", "grunt-simple-mocha": "*", "is-my-json-valid": "^2.12.2",