JSHint wrapper for check different files using different options
JavaScript Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin Group -> FileSet Apr 2, 2015
lib
test
.gitignore Initial commit Jun 14, 2013
.jshintrc add "curly" option to jshintrc Apr 2, 2015
.travis.yml
CHANGELOG.md 0.8.0 Apr 2, 2015
LICENSE
Makefile remove mockery Apr 2, 2015
README.md
package.json 0.8.0 Apr 2, 2015

README.md

jshint-groups Build Status

jshint-groups is a wrapper for JSHint which allows check different files by using different options.

Installation

$ npm install -g jshint-groups

Note: jshint declares as peer dependency and can be update separately.

Usage

Find and check all files described in config:

$ jshint-groups

Check specific files:

$ jshint-groups file1.js file2.js

jshint-groups automatically detects jshint options for each file or ignore it. It can be useful for pre-commit hook.

Configuration file

Configuration file is a js file (nodejs module). By default it has .jshint-groups.js name. Example:

module.exports = {
    options: {
        undef: true,
        unused: true
    },
    groups: {
        client: {
            options: {
                browser: true
            },
            includes: [
                'client/**/*.js'
            ],
            excludes: [
                'client/vendor/**'
            ]
        },

        server: {
            options: {
                node: true
            },
            includes: [
                'server/**'
            ]
        }
    }
};

Properties

  • options Common jshint options. Please see the jshint documentation for more details.
  • groups Each group specifies fileset for validation.
    • options JSHint options for group. This options extends common options.
    • includes List of glob patterns. Please see the minimatch documentation for more details.
    • excludes List of glob patterns to filter include results.

All properties are optional.

License

MIT License.