* Initial automatic cleanup with rubocop * Fix syntax error introduced by rubocop * Cleanup seeds file * Cleanup lib folder * Exclude bin folder because it contains auto generated files * Make Rubocop a little bit more chatty * Block length should not include comments in the count * Cleanup config folder * Cleanup specs * Updated Rubocop version and generated a todo file * Fix broken ArticlesApi spec * Fix tests * Restored rubocop pre-commit hook
29 lines
666 B
Ruby
29 lines
666 B
Ruby
if %w(development test).include? Rails.env
|
|
namespace :lint do
|
|
desc "eslint"
|
|
task :eslint do
|
|
cmd = "cd client && npm run eslint . -- --ext .jsx,.js"
|
|
puts "Running eslint via `#{cmd}`"
|
|
sh cmd
|
|
end
|
|
|
|
desc "jscs"
|
|
task :jscs do
|
|
cmd = "cd client && npm run jscs ."
|
|
puts "Running jscs via `#{cmd}`"
|
|
sh cmd
|
|
end
|
|
|
|
desc "JS Linting"
|
|
task js: %i[eslint jscs] do
|
|
puts "Completed running all JavaScript Linters"
|
|
end
|
|
|
|
task lint: [:js] 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"]
|
|
end
|