Skip to content

Instantly share code, notes, and snippets.

@mattm

mattm/lint.rake

Last active Dec 1, 2015
Embed
What would you like to do?
namespace :lint do
task run: :environment do
js_dir = "#{Rails.root}/app/assets/javascripts"
Dir.chdir(js_dir)
# No directories and no application.js
files = Dir.glob('*').delete_if{ |f| File.directory?(f) || f == 'application.js' }
files.each do |file|
puts file
# There is a likely way to do this with Rake::Task's `invoke` and `reenable` methods
# but I couldn't figure out how to get it to check more than the first file.
puts `rake eslint:run[#{js_dir}/#{file}]`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.