clutchski/coffeelint — pull request #330 by AsaAyers (2014-08-19 16:12:24+00:00)
Title: Expose ErrorReport so that reporters can actually be used by 3rd party projects.

In 1.4.0 I added the `--reporters` option so CoffeeLint could use 3rd party reporters. I thought at the time that other tools like `grunt-coffeelint` would be able to use the same reporters structure. Yesterday I discovered that this simply isn't the case.

Here is a small example you can put in a temporary folder and run.

npm install 'git://github.com/clutchski/coffeelint.git#expose-error-report'
# once this gets release "npm install coffeelint" will be fine.

```CoffeeScript
fs = require 'fs'

CoffeeLint = require 'coffeelint'
DefaultReporter = require 'coffeelint/lib/reporters/default'

errorReport = CoffeeLint.getErrorReport()

files = [ __filename ]
for file in files
errorReport.lint file, fs.readFileSync(file).toString()

reporter = new DefaultReporter errorReport, {
colorize: true
}

reporter.publish()
process.on 'exit', ->
process.exit errorReport.getExitCode()
```