Simple CoffeeLint rake tasks for Rails
Add this line to your application's Gemfile:
gem 'coffeelint-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install coffeelint-rails
This gem provides a simple rake task, rake lint:coffeescript
.
Invoked with no arguments, it will recursively run all .coffee files found in app/assets/javascripts through CoffeeLint, reporting errors on the console.
You can pass it a specific file or directory:
rake lint:coffeescript[app/assets/javascripts/my_file.coffee]
Or a directory to recursively lint:
rake lint:coffeescript[vendor/assets/javascripts]
By default, it will attempt to load configuration from
config/coffeelint.json
; you can create this file with the coffeelint
command:
coffeelint --writeconfig > config/coffeelint.json
You can specify alternate config via the COFFEELINT_CONFIG
environment
variable:
COFFEELINT_CONFIG=~/.coffeelint.json rake lint:coffeescript
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request