Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including karma-coffeelint with all npm packages installed. Try it out:

var karmaCoffeelint = require("karma-coffeelint")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

karma-coffeelint v0.0.1

Lint CoffeeScript in karma

karma-coffeelint

A coffeelint plugin for karma.

Installation

npm i karma-coffeelint --save-dev

Add the configure the coffeelint plugin inside your karma config file.

    module.exports = (config) ->

      config.set

        frameworks: ["jasmine"]

        reporters: ["dots", "coverage"]

        files: [
          "src/**/*.coffee"
          "test/**/*.coffee"
        ]

        preprocessors:
          "src/**/*.coffee"    : ["coffeelint", "coffee"]
          "test/**/*.coffee"   : ["coffee"]

        # karma-coffeelint is preconfigured with the following
        # default options.
        coffeelint:
          onStart: false
          onChange: true
          options: 'coffeelint.json'
          reporter:
            type: 'default'
            options:
              colorize: true

        browsers: ["PhantomJS"]

Options

coffeelint options are specified in the karma config file under the key cofeelint.

NameDescription
onStartRuns coffeelint on every file when karma starts.
onChangeRuns coffeelint on a file change event. Only the modified file is linted
optionsPath to the coffeelint.json config file relative to the karma file. Or you can specify the coffeelint options directly, see the website for a complete list of coffeelint options.
reporter.typedefault, jslint, raw, csv, checkstyle
reporter.optionslow level config options for the coffelint reporter. I'm not sure the options are documented, you can read more in the source.

Default options

defaults = {
  onStart: false,
  onChange: true,
  options: 'coffeelint.json',
  reporter: {
    type: 'default',
    options: {
      colorize: true
    }
  }
};

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new pull request

License

Licensed under the MIT license. See the LICENSE.txt file for more details.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free