From e4ba9ee7a8f98bd291994d6e822ea8ef52ecc14c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 1 Dec 2014 11:32:13 +0100 Subject: [PATCH] Add grunt jshint --- server/sonar-web/.jshintrc | 84 +++++++++++++++++++++++++++++++ server/sonar-web/Gruntfile.coffee | 14 ++++++ server/sonar-web/package.json | 25 ++++----- 3 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 server/sonar-web/.jshintrc diff --git a/server/sonar-web/.jshintrc b/server/sonar-web/.jshintrc new file mode 100644 index 00000000000..64b4d1198ff --- /dev/null +++ b/server/sonar-web/.jshintrc @@ -0,0 +1,84 @@ +{ + "maxerr": 50, + + "bitwise": true, + "camelcase": false, + "curly": true, + "eqeqeq": true, + "forin": true, + "freeze": true, + "immed": false, + "indent": 2, + "latedef": false, + "newcap": false, + "noarg": true, + "noempty": true, + "nonbsp": true, + "nonew": false, + "plusplus": false, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": false, + "maxparams": false, + "maxdepth": 4, + "maxstatements": false, + "maxcomplexity": false, + "maxlen": 120, + + "asi": false, + "boss": false, + "debug": false, + "eqnull": true, + "esnext": false, + "moz": false, + "evil": false, + "expr": false, + "funcscope": false, + "globalstrict": false, + "iterator": false, + "lastsemic": false, + "laxbreak": false, + "laxcomma": false, + "loopfunc": false, + "multistr": false, + "noyield": false, + "notypeof": false, + "proto": false, + "scripturl": false, + "shadow": false, + "sub": false, + "supernew": false, + "validthis": false, + + "browser": true, + "browserify": false, + "couch": false, + "devel": true, + "dojo": false, + "jasmine": false, + "jquery": true, + "mocha": false, + "mootools": false, + "node": false, + "nonstandard": false, + "prototypejs": false, + "qunit": false, + "rhino": false, + "shelljs": false, + "worker": false, + "wsh": false, + "yui": false, + + "globals": { + "jQuery": true, + "$j": true, + "_": true, + "define": true, + "requirejs": true, + "console": true, + "baseUrl": true, + "key": true, + "Backbone": true + } +} diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 6d576c94900..398c742840a 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -318,6 +318,19 @@ module.exports = (grunt) -> src: ['<%= pkg.sources %>js/tests/e2e/tests/<%= grunt.option("spec") %>-spec.js'] + jshint: + dev: + src: [ + '<%= pkg.sources %>js/**/*.js' + '!<%= pkg.sources %>js/third-party/underscore.js' + '!<%= pkg.sources %>js/third-party/**/*.js' + '!<%= pkg.sources %>js/tests/**/*.js' + '!<%= pkg.sources %>js/require.js' + ] + options: + jshintrc: true + + watch: options: spawn: false @@ -351,6 +364,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-contrib-copy' grunt.loadNpmTasks 'grunt-contrib-concat' + grunt.loadNpmTasks 'grunt-contrib-jshint' grunt.loadNpmTasks 'grunt-express-server' grunt.loadNpmTasks 'grunt-casper' diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 9bd6cb730c4..0971f5d2942 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -2,26 +2,27 @@ "name": "SonarQube", "version": "0.0.1", "devDependencies": { - "express": "4.8.0", - "errorhandler": "1.1.1", - "serve-static": "1.5.0", - "jade": "1.4.2", - "phantomjs": "1.9.7-12", "casperjs": "1.1.0-beta3", + "errorhandler": "1.1.1", + "express": "4.8.0", "grunt": "0.4.4", + "grunt-casper": "0.3.9", "grunt-cli": "0.1.13", - "grunt-contrib-less": "0.10.0", + "grunt-contrib-clean": "0.5.0", "grunt-contrib-coffee": "0.10.1", + "grunt-contrib-concat": "0.4.0", + "grunt-contrib-copy": "0.5.0", "grunt-contrib-handlebars": "0.7.0", + "grunt-contrib-jshint": "0.10.0", + "grunt-contrib-less": "0.10.0", "grunt-contrib-requirejs": "0.4.3", - "grunt-contrib-watch": "0.5.3", "grunt-contrib-uglify": "0.4.0", - "grunt-contrib-clean": "0.5.0", - "grunt-contrib-copy": "0.5.0", - "grunt-contrib-concat": "0.4.0", + "grunt-contrib-watch": "0.5.3", "grunt-css-url-rewrite": "0.3.5", - "grunt-casper": "0.3.9", - "grunt-express-server": "0.4.17" + "grunt-express-server": "0.4.17", + "jade": "1.4.2", + "phantomjs": "1.9.7-12", + "serve-static": "1.5.0" }, "engines": { "node": "~0.8 || ~0.10" -- 2.39.5