GithubHelp home page GithubHelp logo

gulp-jscs's Introduction

gulp-jscs Build Status

Check JavaScript code style with jscs

Issues with the output should be reported on the jscs issue tracker.

Install

$ npm install --save-dev gulp-jscs

Usage

var gulp = require('gulp');
var jscs = require('gulp-jscs');

gulp.task('default', function () {
	return gulp.src('src/app.js')
		.pipe(jscs());
});

Results

A jscs object will be attached to the file object which can be used for custom error reporting. An example with one error might look like this:

{
	success: false,  // or true if no errors
	errorCount: 1,   // number of errors in the errors array
	errors: [{       // an array of jscs error objects
		filename: 'index.js',  // basename of the file
		rule: 'requireCamelCaseOrUpperCaseIdentifiers',  // the rule which triggered the error
		message: 'All identifiers must be camelCase or UPPER_CASE',  // error message
		line: 32,  // error line number
		column: 7  // error column
	}]
};

API

jscs(options)

options

Type: object

See the jscs options.

Alternatively you can set the configPath (default: '.jscsrc') option to the path of a .jscsrc file.

Set esnext: true if you want your code to be parsed as ES6 using the harmony version of the esprima parser.

License

MIT © Sindre Sorhus

gulp-jscs's People

Contributors

jansensan avatar joemaller avatar kadamwhite avatar koistya avatar kutsenkoa avatar lukaszfiszer avatar mikesherov avatar moox avatar sboudrias avatar sindresorhus avatar tcoopman avatar thomasdezeeuw avatar ultcombo 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.