From aebc7ce0d26e714e187a99a696367c3972a79074 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sun, 21 Sep 2014 15:21:43 -0400 Subject: [PATCH] Added very basic jshint config --- .jshintignore | 1 + .jshintrc | 5 +++++ Gruntfile.js | 15 ++++++++++++++- package.json | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .jshintignore create mode 100644 .jshintrc diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 00000000..20526735 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +tests/vendor/*.js diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000..108a2316 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,5 @@ +{ + "bitwise": true, + "indent": 2, + "quotmark": "single" +} diff --git a/Gruntfile.js b/Gruntfile.js index 1b1e682f..0aa3045e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,18 @@ module.exports = function (grunt) { ] }, + jshint: { + options: { + jshintrc: true + }, + code: { + src: ["src/js/**/*.js"] + }, + tests: { + src: ["tests/**/*.js"] + } + }, + sass: { dist: { options: { @@ -145,6 +157,7 @@ module.exports = function (grunt) { }); grunt.loadNpmTasks("grunt-contrib-concat") + grunt.loadNpmTasks("grunt-contrib-jshint") grunt.loadNpmTasks("grunt-contrib-qunit") grunt.loadNpmTasks("grunt-contrib-requirejs") grunt.loadNpmTasks("grunt-contrib-uglify") @@ -156,5 +169,5 @@ module.exports = function (grunt) { grunt.registerTask("compile", ["requirejs", "sass:dev", "concat"]) grunt.registerTask("minify", ["uglify", "sass:dist"]) - grunt.registerTask("test", ["qunit"]) + grunt.registerTask("test", ["qunit", "jshint"]) } diff --git a/package.json b/package.json index 653b5e75..6652308d 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "grunt": "^0.4.5", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.4.0", + "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-nodeunit": "~0.3.3", "grunt-contrib-qunit": "~0.4.0", "grunt-contrib-requirejs": "^0.4.4",