0.0.2 • Published 3 years ago

karma-coffeelint v0.0.2

Weekly downloads
17
License
-
Repository
github
Last release
3 years ago

karma-coffeelint

Build Status

NPM Package Stats

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.