浏览代码

Added very basic jshint config

Kevin Brown 10 年之前
父节点
当前提交
aebc7ce0d2
共有 4 个文件被更改,包括 21 次插入1 次删除
  1. 1 0
      .jshintignore
  2. 5 0
      .jshintrc
  3. 14 1
      Gruntfile.js
  4. 1 0
      package.json

+ 1 - 0
.jshintignore

@@ -0,0 +1 @@
+tests/vendor/*.js

+ 5 - 0
.jshintrc

@@ -0,0 +1,5 @@
+{
+  "bitwise": true,
+  "indent": 2,
+  "quotmark": "single"
+}

+ 14 - 1
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"])
 }

+ 1 - 0
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",