Gulp plugin for jscodesniffer
Gulp plugin for the jscodesniffer project.
npm install gulp-jscodesniffer --save-dev
Optional | Default:EmptyString
A string defining a pre-made jscodesniffer coding standard. As of writing this only two pre-made standards exist,
Jquery. You can read more about them at the jscodesniffer repo.
Optional | Default:EmptyObj
Path to a jscodesniffer JSON configuration file. Without a defined
standard this can be used on its own as the only source of rules. When used together with a
rc rules will take precedent. Here's our example .jscsrc. Note that if you define neither a
standard nor a
rc then no style checking will occur.
Optional | Default:['default']
An array of reporters used to process jscodesniffer output. There are three supplied reporters, which are detailed below. To use a supplied reporter add its name to the
reporters array. You can add your own custom reporter by adding it to the array as a function (have a look at the supplied reporters for help).
Prints out pleasantly formatted information about failures to the console.
Rings your terminal bell if any failures occurred.
By default this Gulp plugin will not fail its task if it encounters style breaches. Add this reporter to emit an error into the stream and fail the task.
var gulp = require'gulp';var jscs = require'gulp-jscodesniffer';gulptask'jscs'return gulpsrc'src/**/*.js'pipejscsrc: '.jscsrc'standard: 'Idiomatic'reporters: 'default''beep';;
Run the Mocha tests:
Run this project's gulpfile against its fixtures and
npm run jscs