From d0541bc867344d373cc704fbe207240b1fd9e273 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Tue, 11 Feb 2014 11:48:00 -0800 Subject: [PATCH] retighten up the linting rules --- .jshintrc | 2 +- app/.jshintrc | 30 ++++++++++++++++++++++++++++++ grunttasks/jscs.js | 9 ++++----- grunttasks/jshint.js | 20 ++++++++++++++------ grunttasks/yeoman.js | 3 ++- 5 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 app/.jshintrc diff --git a/.jshintrc b/.jshintrc index 65780c4bd..ca5fe0406 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,9 +1,9 @@ { "bitwise": true, - "browser": true, "curly": true, "eqeqeq": true, "esnext": true, + "globalstrict": false, "immed": true, "indent": 2, "jquery": true, diff --git a/app/.jshintrc b/app/.jshintrc new file mode 100644 index 000000000..f736b8904 --- /dev/null +++ b/app/.jshintrc @@ -0,0 +1,30 @@ +{ + "bitwise": true, + "browser": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "esnext": true, + "globalstrict": true, + "immed": true, + "indent": 2, + "jquery": true, + "latedef": true, + "newcap": true, + "noarg": true, + "node": false, + "quotmark": "single", + "regexp": true, + "smarttabs": true, + "strict": true, + "trailing": true, + "undef": true, + "unused": true, + "globals": { + "require": true, + "console": true, + "define": true, + "router": true, + "translator": true + } +} diff --git a/grunttasks/jscs.js b/grunttasks/jscs.js index 6b59a157a..6e8cda2b5 100644 --- a/grunttasks/jscs.js +++ b/grunttasks/jscs.js @@ -8,11 +8,10 @@ module.exports = function (grunt) { grunt.config('jscs', { src: [ '**/*.js', - '!dist/**', - '!node_modules/**', - '!fxa-auth-server/**', - '!**/bower_components/**', - '!**/vendor/**' + '!<%= yeoman.app %>/bower_components/**', + '!<%= yeoman.app %>/scripts/vendor/**', + '!<%= yeoman.dist %>/**', + '!node_modules/**' ], options: { config: '.jscs.json' diff --git a/grunttasks/jshint.js b/grunttasks/jshint.js index d7634de61..3ab42d810 100644 --- a/grunttasks/jshint.js +++ b/grunttasks/jshint.js @@ -12,13 +12,21 @@ module.exports = function (grunt) { }, grunt: [ 'Gruntfile.js', - 'grunttasks/{,*/}*.js' + 'grunttasks/*.js' ], - all: [ - '<%= yeoman.app %>/scripts/{,*/}*.js', - '!<%= yeoman.app %>/scripts/vendor/*', - 'server/**/*.js', - 'tests/{,*/}*.js' + app: { + options: { + jshintrc: '<%= yeoman.app %>/.jshintrc' + }, + src: [ + '<%= yeoman.app %>/**/*.js', + '!<%= yeoman.app %>/bower_components/**', + '!<%= yeoman.app %>/scripts/vendor/**', + '!<%= yeoman.app %>/tests/**' + ] + }, + tests: [ + '<%= yeoman.tests %>/**/*.js' ] }); }; diff --git a/grunttasks/yeoman.js b/grunttasks/yeoman.js index a6873ad6d..60de2a086 100644 --- a/grunttasks/yeoman.js +++ b/grunttasks/yeoman.js @@ -7,6 +7,7 @@ module.exports = function (grunt) { grunt.config('yeoman', { app: 'app', - dist: 'dist' + dist: 'dist', + tests: 'tests' }); };