broccoli-jshint

2.1.0 • Public • Published

Broccoli JSHint

Build Status

Run JSHint on the provided node.

Usage

var JSHinter = require('broccoli-jshint');
 
// Assuming someNode contains .js files
var node = new JSHinter(someNode);

Documentation

new JSHinter(inputNode, options)


options.jshintrcRoot {String}

Will look in the root of the provided node for a .jshintrc. If you would prefer to use another specific root for looking up your JSHint config, supply this option.

Default: input node root


options.jshintrcPath {String}

Specify the path to the .jshintrc that you would like to use. Use this option if you would like to use a .jshintrc file from a path that is not in the same hierarchy as your input node (if it is use the .jshintrcRoot).

Default: undefined


options.log {true|false}

Should we log errors to the console?

Default: true


options.disableTestGenerator {true|false}

If true tests will not be generated.

Default: false


options.testGenerator {Function}

The function used to generate test modules. You can provide a custom function for your client side testing framework of choice.

The function receives the following arguments:

  • relativePath - The relative path to the file being tested.
  • errors - A generated string of errors found.

Default generates QUnit style tests:

var path = require('path');
 
function(relativePath, errors) {
  return "module('" + path.dirname(relativePath) + '");";
         "test('" + relativePath + "' should pass jshint', function() { " +
         "  ok(passed, moduleName+" should pass jshint."+(errors ? "\n"+errors : '')); " +
         "});
};

options.console {Object}

Allows you to provide a custom console object. This is useful if you have to supress console output in CI for example.

Default: console


options.annotation {String}

A human-readable description for this plugin instance.

Default: undefined

ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.01,703release-1-x
2.1.0448latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.0448
1.2.01,703
2.0.01
1.1.22
1.1.11
1.1.01
1.0.02
0.5.8121
0.5.73
0.5.6116
0.5.5290
0.5.40
0.5.362
0.5.20
0.5.10
0.5.00
0.4.00
0.3.41
0.3.30
0.3.20
0.3.10
0.3.00
0.2.00
0.1.10
0.1.00

Package Sidebar

Install

npm i broccoli-jshint

Weekly Downloads

2,751

Version

2.1.0

License

MIT

Last publish

Collaborators

  • rwjblue
  • stefanpenner