Skip to content

nolemmings/browserify-coffeelint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browserify Coffeelint transform

This simple 'transform' enables to integrate your coffeelint with browserify. This makes for a simpler watch, and only lints what you acutally use. Especially good with watchify.

Install

npm install browserify-coffeelint --save-dev

Use

Just use as normal transform. Transform options are passed through as coffeelint options.

browserify -t browserify-coffeelint -t coffeeify main.coffee -o bundle.js

Config

It automatically looks for coffeelint.json in the default places (since 1.1.0). To generate such a file, execute:

coffeelint --makeconfig > coffeelint.json

It is also possible to set (/overide) these settings using browserify options.

Example using package.json:

"browserify": {
  "transform": [
    [
      "browserify-coffeelint",
      {
        "arrow_spacing": {
          "name": "arrow_spacing",
          "level": "error"
        }
      }
    ]
  ]
}

Example using programmatic API:

browserify            = require 'browserify'
browserify_coffeelint = require 'browserify-coffeelint'
coffeeify             = require 'coffeeify'

options =
  arrow_spacing:
    name:  'arrow_spacing'
    level: 'error'

browserify()
.add 'main.coffee'
.transform browserify_coffeelint, options
.transform coffeeify
.bundle()
.pipe process.stdout

Options

Thanks to @nmccready, it is also possible to fail on error or warning. Just pass the options doEmitErrors or doEmitWarnings.