##JSHint On Rails JSHint on rails is a fork project from JSLint_on_rails, adapted to work with jshint.
- Java 5 >
- Ruby 1.8 >
- Rails 2 >
gem 'jshint_on_rails'to you're projects Gemfile
The first time you run it, a file in config/jshint.yml will be created. It can be customized to fit your needs (well explained below).
As this project is a fork of psionides jslint_on_rails, the instructions are the same. Click here to follow his instructions.
After the installation, observe that you'll probably will need to customize some settings, for example, the files you want to test and the ones you want to ignore (ex.: libraries such as jquery, mootools, underscore, etc).
The default config allows you to:
- write single line conditional statements
- ignore whitespaces (to support the option above and still being indented)
To start checking your stuff run the following:
[bundle exec] rake jshint
Then you should see:
If anything is wrong, you will get something like this instead:
If you want to test specific file or files (just once, without modifying the config), you can pass paths to include and/or paths to exclude to the rake task: