From c919a8672b7661092a69703090aee6e8d47d422c Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 14 Dec 2014 12:14:56 -0800 Subject: [PATCH] Use JSHint. --- Gruntfile.coffee | 37 +++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index f11582ef9..773009de8 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -214,6 +214,41 @@ module.exports = (grunt) -> options: template: 'template.jst' + jshint: + options: + undef: true + eqnull: true + expr: true + shadow: true + sub: true + scripturl: true + browser: true + devel: true + nonstandard: true + # XXX Temporarily suppress lots of existing warnings until we fix them. + '-W018': true + '-W027': true + '-W044': true + '-W053': true + '-W084': true + '-W058': true + '-W083': true + '-W093': true + globals: + Notification: true + webkitNotifications: true + HTMLDocument: true + MediaError: true + GM_getValue: true + GM_setValue: true + GM_deleteValue: true + GM_openInTab: true + GM_info: true + GM_xmlhttpRequest: true + cloneInto: true + chrome: true + script: 'tmp-<%= pkg.type %>/*.js' + require('load-grunt-tasks') grunt grunt.registerTask 'default', [ @@ -250,6 +285,7 @@ module.exports = (grunt) -> 'concat:coffee' 'coffee:script' 'coffee:eventPage' + 'jshint:script' 'set-channel:stable' 'build-crx-channel' 'set-channel:beta' @@ -273,6 +309,7 @@ module.exports = (grunt) -> 'set-build:userscript' 'concat:coffee' 'coffee:script' + 'jshint:script' 'set-channel:stable' 'concat:userscript' 'set-channel:beta' diff --git a/package.json b/package.json index cc731d963..4802b2905 100755 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "grunt-contrib-compress": "0.12.0", "grunt-contrib-concat": "0.5.0", "grunt-contrib-copy": "0.7.0", + "grunt-contrib-jshint": "0.10.0", "grunt-contrib-watch": "0.6.1", "grunt-crx": "0.3.4", "grunt-markdown": "0.6.1", @@ -68,4 +69,4 @@ "engines": { "node": ">=0.10" } -} \ No newline at end of file +}