Skip to content

Commit

Permalink
Adds jshint gem
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed May 30, 2014
1 parent 098339e commit d0b3c3b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Expand Up @@ -59,6 +59,9 @@ group :development do
gem "binding_of_caller", ">= 0.7.1", :platforms => [:mri_19, :rbx]
gem "metric_fu"
gem "letter_opener" # for mocking emails for sending

# For linting JS with `rake jshint`.
gem 'jshintrb', '>= 0.2.4'
end

group :test do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -142,6 +142,10 @@ GEM
railties (>= 3.2.0, < 5.0)
i18n (0.6.9)
journey (1.0.4)
jshintrb (0.2.4)
execjs
multi_json (>= 1.3)
rake
json (1.8.1)
json_pure (1.8.1)
jwt (0.1.11)
Expand Down Expand Up @@ -338,6 +342,7 @@ DEPENDENCIES
google-api-client
haml-rails
html5shiv-rails
jshintrb (>= 0.2.4)
json
kgio
letter_opener
Expand Down
41 changes: 41 additions & 0 deletions lib/tasks/jshint.rake
@@ -0,0 +1,41 @@
# Load JSHint when jshintrb gem is available
begin
require "jshintrb/jshinttask"
Jshintrb::JshintTask.new :jshint do |t|
t.pattern = "app/assets/javascripts/**/*.js"
#t.options = :defaults
# Custom options are below, uncomment the line
# above for the default set of options.
t.options = {
:bitwise => true,
:curly => false,
:eqeqeq => true,
:forin => true,
:immed => true,
:indent => 2,
:latedef => true,
:newcap => true,
:noarg => true,
:noempty => true,
:nonew => true,
:plusplus => false,
:regexp => true,
:undef => true,
:strict => true,
:trailing => true,
:sub => true,
:browser => true,
:devel => true,
:expr => true,
:predef => {
"requirejs" => false,
"require" => false,
"define" => false,
"Modernizr" => false,
"selectorSupported" => false,
"google" => false
}
}
end
rescue LoadError
end

0 comments on commit d0b3c3b

Please sign in to comment.