Code Monkey home page Code Monkey logo

broccoli-jshint's Introduction

Broccoli JSHint

Build Status

Run JSHint on the provided tree.

Usage

var jshintTree = require('broccoli-jshint');

// assuming someTree is a built up tree
var tree = jshintTree(someTree);

Documentation

jshintTree(inputTree, options)


options.jshintrcRoot {String}

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

Default: input tree 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 heirarchy as your input tree (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

ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

broccoli-jshint's People

Contributors

rwjblue avatar cyril-sf avatar patsy-issa avatar sebastianseilund avatar wmeldon avatar

Watchers

James Cloos avatar Markus Padourek avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.