Skip to content

Commit

Permalink
Use jshintrb and guard-jshintrb instead of jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen van Bergerem committed Mar 18, 2015
1 parent 5115582 commit 6d070c8
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 87 deletions.
1 change: 1 addition & 0 deletions .jshintignore
1 change: 1 addition & 0 deletions .jshintrc
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,16 @@ end
group :development do
# Automatic test runs
gem "guard-cucumber", "1.5.3"
gem "guard-jshintrb", "1.1.1"
gem "guard-rspec", "4.5.0"
gem "guard-rubocop", "1.2.0"
gem "guard", "2.12.4", require: false
gem "rb-fsevent", "0.9.4", require: false
gem "rb-inotify", "0.9.5", require: false

# Linters
gem "jshint", "1.3.1"
gem "rubocop", "0.29.1"
gem "jshintrb", "0.3.0"
gem "rubocop", "0.29.1"

# Preloading environment

Expand Down
19 changes: 9 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ GEM
guard (>= 2.0.0)
guard-compat (~> 1.0)
nenv (~> 0.1)
guard-jshintrb (1.1.1)
guard (~> 2.0)
jshintrb
guard-rspec (4.5.0)
guard (~> 2.1)
guard-compat (~> 1.1)
Expand Down Expand Up @@ -366,17 +369,16 @@ GEM
sprockets-rails
js_image_paths (0.0.2)
rails (~> 4.0)
jshint (1.3.1)
execjs (>= 1.4.0)
multi_json (~> 1.0)
therubyracer (~> 0.12.1)
jshintrb (0.3.0)
execjs
multi_json (>= 1.3)
rake
json (1.8.2)
jwt (1.3.0)
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.3)
libv8 (3.16.14.7)
listen (2.8.5)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
Expand Down Expand Up @@ -566,7 +568,6 @@ GEM
redis (3.2.1)
redis-namespace (1.5.1)
redis (~> 3.0, >= 3.0.4)
ref (1.0.5)
remotipart (1.2.1)
request_store (1.1.0)
responders (2.1.0)
Expand Down Expand Up @@ -656,9 +657,6 @@ GEM
systemu (2.6.4)
test_after_commit (0.4.0)
activerecord (>= 3.2)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
Expand Down Expand Up @@ -736,6 +734,7 @@ DEPENDENCIES
gon (= 5.2.3)
guard (= 2.12.4)
guard-cucumber (= 1.5.3)
guard-jshintrb (= 1.1.1)
guard-rspec (= 4.5.0)
guard-rubocop (= 1.2.0)
haml (= 4.0.6)
Expand All @@ -747,7 +746,7 @@ DEPENDENCIES
jquery-rails (= 3.1.2)
js-routes (= 1.0.0)
js_image_paths (= 0.0.2)
jshint (= 1.3.1)
jshintrb (= 0.3.0)
json (= 1.8.2)
markerb (= 1.0.2)
messagebus_ruby_api (= 1.0.3)
Expand Down
6 changes: 6 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ guard :rubocop, all_on_start: false, keep_failed: false do
watch(/(?:app|config|db|lib|features|spec)\/.+\.rb$/)
watch(/(config.ru|Gemfile|Guardfile|Rakefile)$/)
end

guard :jshintrb do
watch(/^app\/assets\/javascripts\/.+\.js$/)
watch(/^lib\/assets\/javascripts\/.+\.js$/)
watch(/^spec\/javascripts\/.+\.js$/)
end
1 change: 0 additions & 1 deletion config/.jshint_ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ vendor/assets/javascripts/**.js
lib/assets/javascripts/fileuploader-custom.js
lib/assets/javascripts/jquery.autoresize.js
lib/assets/javascripts/jquery.mentionsInput.js
lib/assets/javascripts/markdown-it-diaspora-linkify.js
74 changes: 0 additions & 74 deletions config/jshint.yml

This file was deleted.

12 changes: 12 additions & 0 deletions lib/tasks/linter.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
begin
require "jshintrb/jshinttask"
Jshintrb::JshintTask.new :jshint do |t|
t.pattern = "{app/assets,lib/assets,spec}/javascripts/**/*.js"
t.options = :jshintrc
end
rescue LoadError
desc "jshint rake task not available (jshintrb not installed)"
task :jshint do
abort "JSHint rake task is not available. Be sure to install jshintrb."
end
end

0 comments on commit 6d070c8

Please sign in to comment.