forked from shakacode/react_on_rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint.rake
41 lines (32 loc) · 1022 Bytes
/
lint.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true
require_relative "task_helpers"
namespace :lint do # rubocop:disable Metrics/BlockLength
include ReactOnRails::TaskHelpers
desc "Run Rubocop as shell"
task :rubocop do
sh_in_dir(gem_root, "bundle exec rubocop .")
end
desc "Run ruby-lint as shell"
task :ruby do
puts "See /ruby-lint.yml for what directories are included."
sh_in_dir(gem_root, "bundle exec ruby-lint .")
end
desc "Run scss-lint as shell"
task :scss do
sh_in_dir(gem_root, "bundle exec scss-lint spec/dummy/app/assets/stylesheets/")
end
desc "Run eslint as shell"
task :eslint do
sh_in_dir(gem_root, "yarn run eslint")
end
desc "Run flow from shell"
task :flow do
sh_in_dir(gem_root, "yarn run flow")
end
desc "Run all eslint, flow, rubocop linters. Skip ruby-lint and scss"
task lint: %i[eslint flow rubocop] do
puts "Completed all linting"
end
end
desc "Runs all linters. Run `rake -D lint` to see all available lint options"
task lint: ["lint:lint"]