Check JSX code style with JSCS.
$ npm install --save-dev gulp-jsxcs
To perform JSX code style checks using the default JSCS configuration
path at ./.jscsrc
, run the following.
var gulp = require('gulp'),
jsxcs = require('gulp-jsxcs');
gulp.task('default', function () {
return gulp.src('src/app.js')
.pipe(jsxcs());
});
You may also explicitly define the JSCS configuration file.
var gulp = require('gulp'),
jsxcs = require('gulp-jsxcs');
gulp.task('default', function () {
return gulp.src('src/app.js')
.pipe(jsxcs('./my-jscs-config.json'));
});
If you do not wish to rely on a configuration file, you may pass the JSCS options directly.
var gulp = require('gulp'),
jsxcs = require('gulp-jsxcs');
gulp.task('default', function () {
return gulp.src('src/app.js')
.pipe(jsxcs({
disallowTrailingComma: true,
validateQuoteMarks: {
escape: true,
mark: '\''
}
}));
});
See the JSCS options for details on the options available for checking.
MIT © Adam Gschwender
This module is little more than a merge of gulp-jscs, gulp-react and jsxcs. So a thank you to the contributors of those projects.