Use jshintrb and guard-jshintrb instead of jshint
This commit is contained in:
parent
5115582c55
commit
6d070c818c
8 changed files with 32 additions and 87 deletions
1
.jshintignore
Symbolic link
1
.jshintignore
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
config/.jshint_ignore
|
||||||
1
.jshintrc
Symbolic link
1
.jshintrc
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
config/.jshint.json
|
||||||
5
Gemfile
5
Gemfile
|
|
@ -213,6 +213,7 @@ end
|
||||||
group :development do
|
group :development do
|
||||||
# Automatic test runs
|
# Automatic test runs
|
||||||
gem "guard-cucumber", "1.5.3"
|
gem "guard-cucumber", "1.5.3"
|
||||||
|
gem "guard-jshintrb", "1.1.1"
|
||||||
gem "guard-rspec", "4.5.0"
|
gem "guard-rspec", "4.5.0"
|
||||||
gem "guard-rubocop", "1.2.0"
|
gem "guard-rubocop", "1.2.0"
|
||||||
gem "guard", "2.12.4", require: false
|
gem "guard", "2.12.4", require: false
|
||||||
|
|
@ -220,8 +221,8 @@ group :development do
|
||||||
gem "rb-inotify", "0.9.5", require: false
|
gem "rb-inotify", "0.9.5", require: false
|
||||||
|
|
||||||
# Linters
|
# Linters
|
||||||
gem "jshint", "1.3.1"
|
gem "jshintrb", "0.3.0"
|
||||||
gem "rubocop", "0.29.1"
|
gem "rubocop", "0.29.1"
|
||||||
|
|
||||||
# Preloading environment
|
# Preloading environment
|
||||||
|
|
||||||
|
|
|
||||||
19
Gemfile.lock
19
Gemfile.lock
|
|
@ -317,6 +317,9 @@ GEM
|
||||||
guard (>= 2.0.0)
|
guard (>= 2.0.0)
|
||||||
guard-compat (~> 1.0)
|
guard-compat (~> 1.0)
|
||||||
nenv (~> 0.1)
|
nenv (~> 0.1)
|
||||||
|
guard-jshintrb (1.1.1)
|
||||||
|
guard (~> 2.0)
|
||||||
|
jshintrb
|
||||||
guard-rspec (4.5.0)
|
guard-rspec (4.5.0)
|
||||||
guard (~> 2.1)
|
guard (~> 2.1)
|
||||||
guard-compat (~> 1.1)
|
guard-compat (~> 1.1)
|
||||||
|
|
@ -366,17 +369,16 @@ GEM
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
js_image_paths (0.0.2)
|
js_image_paths (0.0.2)
|
||||||
rails (~> 4.0)
|
rails (~> 4.0)
|
||||||
jshint (1.3.1)
|
jshintrb (0.3.0)
|
||||||
execjs (>= 1.4.0)
|
execjs
|
||||||
multi_json (~> 1.0)
|
multi_json (>= 1.3)
|
||||||
therubyracer (~> 0.12.1)
|
rake
|
||||||
json (1.8.2)
|
json (1.8.2)
|
||||||
jwt (1.3.0)
|
jwt (1.3.0)
|
||||||
kaminari (0.16.3)
|
kaminari (0.16.3)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
kgio (2.9.3)
|
kgio (2.9.3)
|
||||||
libv8 (3.16.14.7)
|
|
||||||
listen (2.8.5)
|
listen (2.8.5)
|
||||||
celluloid (>= 0.15.2)
|
celluloid (>= 0.15.2)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
|
|
@ -566,7 +568,6 @@ GEM
|
||||||
redis (3.2.1)
|
redis (3.2.1)
|
||||||
redis-namespace (1.5.1)
|
redis-namespace (1.5.1)
|
||||||
redis (~> 3.0, >= 3.0.4)
|
redis (~> 3.0, >= 3.0.4)
|
||||||
ref (1.0.5)
|
|
||||||
remotipart (1.2.1)
|
remotipart (1.2.1)
|
||||||
request_store (1.1.0)
|
request_store (1.1.0)
|
||||||
responders (2.1.0)
|
responders (2.1.0)
|
||||||
|
|
@ -656,9 +657,6 @@ GEM
|
||||||
systemu (2.6.4)
|
systemu (2.6.4)
|
||||||
test_after_commit (0.4.0)
|
test_after_commit (0.4.0)
|
||||||
activerecord (>= 3.2)
|
activerecord (>= 3.2)
|
||||||
therubyracer (0.12.1)
|
|
||||||
libv8 (~> 3.16.14.0)
|
|
||||||
ref
|
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.4)
|
thread_safe (0.3.4)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
|
|
@ -736,6 +734,7 @@ DEPENDENCIES
|
||||||
gon (= 5.2.3)
|
gon (= 5.2.3)
|
||||||
guard (= 2.12.4)
|
guard (= 2.12.4)
|
||||||
guard-cucumber (= 1.5.3)
|
guard-cucumber (= 1.5.3)
|
||||||
|
guard-jshintrb (= 1.1.1)
|
||||||
guard-rspec (= 4.5.0)
|
guard-rspec (= 4.5.0)
|
||||||
guard-rubocop (= 1.2.0)
|
guard-rubocop (= 1.2.0)
|
||||||
haml (= 4.0.6)
|
haml (= 4.0.6)
|
||||||
|
|
@ -747,7 +746,7 @@ DEPENDENCIES
|
||||||
jquery-rails (= 3.1.2)
|
jquery-rails (= 3.1.2)
|
||||||
js-routes (= 1.0.0)
|
js-routes (= 1.0.0)
|
||||||
js_image_paths (= 0.0.2)
|
js_image_paths (= 0.0.2)
|
||||||
jshint (= 1.3.1)
|
jshintrb (= 0.3.0)
|
||||||
json (= 1.8.2)
|
json (= 1.8.2)
|
||||||
markerb (= 1.0.2)
|
markerb (= 1.0.2)
|
||||||
messagebus_ruby_api (= 1.0.3)
|
messagebus_ruby_api (= 1.0.3)
|
||||||
|
|
|
||||||
|
|
@ -37,3 +37,9 @@ guard :rubocop, all_on_start: false, keep_failed: false do
|
||||||
watch(/(?:app|config|db|lib|features|spec)\/.+\.rb$/)
|
watch(/(?:app|config|db|lib|features|spec)\/.+\.rb$/)
|
||||||
watch(/(config.ru|Gemfile|Guardfile|Rakefile)$/)
|
watch(/(config.ru|Gemfile|Guardfile|Rakefile)$/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
guard :jshintrb do
|
||||||
|
watch(/^app\/assets\/javascripts\/.+\.js$/)
|
||||||
|
watch(/^lib\/assets\/javascripts\/.+\.js$/)
|
||||||
|
watch(/^spec\/javascripts\/.+\.js$/)
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,3 @@ vendor/assets/javascripts/**.js
|
||||||
lib/assets/javascripts/fileuploader-custom.js
|
lib/assets/javascripts/fileuploader-custom.js
|
||||||
lib/assets/javascripts/jquery.autoresize.js
|
lib/assets/javascripts/jquery.autoresize.js
|
||||||
lib/assets/javascripts/jquery.mentionsInput.js
|
lib/assets/javascripts/jquery.mentionsInput.js
|
||||||
lib/assets/javascripts/markdown-it-diaspora-linkify.js
|
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
files: ['**/*.js']
|
|
||||||
|
|
||||||
exclude_paths: [
|
|
||||||
'vendor/assets/javascripts',
|
|
||||||
'lib/assets/javascripts'
|
|
||||||
]
|
|
||||||
|
|
||||||
options:
|
|
||||||
# enforcing options
|
|
||||||
bitwise: true
|
|
||||||
camelcase: false
|
|
||||||
curly: true
|
|
||||||
eqeqeq: true
|
|
||||||
forin: true
|
|
||||||
freeze: true
|
|
||||||
immed: true
|
|
||||||
indent: 2
|
|
||||||
latedef: true
|
|
||||||
maxlen: false
|
|
||||||
newcap: true
|
|
||||||
noarg: true
|
|
||||||
noempty: true
|
|
||||||
nonbsp: true
|
|
||||||
nonew: false
|
|
||||||
quotmark: false
|
|
||||||
undef: true
|
|
||||||
unused: true
|
|
||||||
|
|
||||||
# relaxing options
|
|
||||||
asi: false
|
|
||||||
boss: false
|
|
||||||
browser: true
|
|
||||||
devel: true
|
|
||||||
eqnull: true
|
|
||||||
evil: false
|
|
||||||
expr: false
|
|
||||||
jasmine: true
|
|
||||||
jquery: true
|
|
||||||
lastsemic: true
|
|
||||||
laxbreak: false
|
|
||||||
laxcomma: false
|
|
||||||
loopfunc: false
|
|
||||||
notypeof: false
|
|
||||||
scripturl: false
|
|
||||||
sub: false
|
|
||||||
supernew: true
|
|
||||||
|
|
||||||
globals:
|
|
||||||
"_": true
|
|
||||||
"Backbone": true
|
|
||||||
"gon": true
|
|
||||||
"Handlebars": true
|
|
||||||
"HandlebarsTemplates": true
|
|
||||||
"ImagePaths": true
|
|
||||||
"jsxc": true
|
|
||||||
"MBP": true
|
|
||||||
"Routes": true
|
|
||||||
"OSM": true
|
|
||||||
"parse_url": true
|
|
||||||
"punycode": true
|
|
||||||
"qq": true
|
|
||||||
|
|
||||||
"loginAs": true
|
|
||||||
"logout": true
|
|
||||||
"spec": true
|
|
||||||
"context": true
|
|
||||||
"factory": true
|
|
||||||
"stubView": true
|
|
||||||
"exports": true
|
|
||||||
|
|
||||||
"app": true
|
|
||||||
"Diaspora": true
|
|
||||||
"Mentions": true
|
|
||||||
"PosixBracketExpressions": true
|
|
||||||
12
lib/tasks/linter.rake
Normal file
12
lib/tasks/linter.rake
Normal file
|
|
@ -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
|
||||||
Loading…
Reference in a new issue