From: Tom Hughes Date: Mon, 23 Feb 2015 21:42:54 +0000 (+0000) Subject: Add JSHint support X-Git-Tag: live~4197 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/6671a934bf10ad202576d5ca0c1591cf2ef627f8 Add JSHint support --- diff --git a/Gemfile b/Gemfile index 83a941d6f..6a1bbc66e 100644 --- a/Gemfile +++ b/Gemfile @@ -90,6 +90,7 @@ end # Needed in development as well so rake can see konacha tasks group :development, :test do + gem "jshint" gem "konacha" gem "poltergeist" end diff --git a/Gemfile.lock b/Gemfile.lock index f4a2c9b5b..f40dc2b72 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,10 @@ GEM rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + jshint (1.3.1) + execjs (>= 1.4.0) + multi_json (~> 1.0) + therubyracer (~> 0.12.1) json (1.8.2) jsonify (0.3.1) multi_json (~> 1.0) @@ -102,6 +106,7 @@ GEM colorize railties (>= 3.1, < 5) sprockets + libv8 (3.16.14.7) libxml-ruby (2.8.0) loofah (2.0.1) nokogiri (>= 1.5.9) @@ -186,6 +191,7 @@ GEM rainbow (2.0.0) rake (10.4.2) redcarpet (3.2.2) + ref (1.0.5) rinku (1.7.3) rubocop (0.29.1) astrolabe (~> 1.3) @@ -195,7 +201,7 @@ GEM ruby-progressbar (~> 1.4) ruby-openid (2.6.0) ruby-progressbar (1.7.1) - sanitize (3.1.1) + sanitize (3.1.2) crass (~> 1.0.1) nokogiri (>= 1.4.4) nokogumbo (= 1.2.0) @@ -216,6 +222,9 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) + therubyracer (0.12.1) + libv8 (~> 3.16.14.0) + ref thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) @@ -228,7 +237,7 @@ GEM validates_email_format_of (1.6.2) i18n vendorer (0.1.16) - websocket-driver (0.5.2) + websocket-driver (0.5.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) xpath (2.0.0) @@ -251,6 +260,7 @@ DEPENDENCIES http_accept_language (~> 2.0.0) httpclient jquery-rails + jshint json jsonify-rails kgio diff --git a/config/jshint.yml b/config/jshint.yml new file mode 100644 index 000000000..5ce76655b --- /dev/null +++ b/config/jshint.yml @@ -0,0 +1,30 @@ +files: + - "**/*.js" +exclude_paths: + - "vendor/assets/javascripts" +options: + eqeqeq: true + freeze: true + latedef: "nofunc" + noarg: true + noempty: true + nonew: true + undef: true + browser: true + jquery: true + unused: true + trailing: true + globals: + I18n: true + L: true + OSM: true + Piwik: true + escapeHTML: false + getUserIcon: false + initializeBrowse: false + initializeNotes: false + maximiseMap: false + minimiseMap: false + querystring: false + remoteEditHandler: false + updateLinks: false