Senior Frontend Developer @ SC5 Online
You develop but you don’t code with respect
You don’t even follow the codestyle
And with that, JSCS now has all the style enforcement rules that are
being dropped in @JSHint 3.0: https://t.co/W98EMSiTN5 cc @valueof
— Mike Sherov (@mikesherov) 4 января 2014
gulp.task('jslint',
[ 'jshint', 'jscs' ]
);
$ npm install jscs
.jscsrc
{
"preset": "airbnb",
/*
"preset": crockford,
"preset": google,
"preset": jquery,
"preset": mdcs,
"preset": wikimedia,
"preset": yandex
*/
}
{
"preset": "airbnb",
"excludeFiles": [
"node_modules/**"
]
}
{
"preset": "airbnb",
"validateIndentation": 2,
"requireMultipleVarDecl": true,
"excludeFiles": [
"node_modules/**"
]
}
{
...
"excludeFiles": [
"node_modules/**",
"src/modules/a/**",
"src/modules/b/**",
"src/*.js
]
}
upstream repositorymust be clean
|
your forkmay be clean
|
gulp.task('jscs', function() {
return gulp.src([
'**/*.js'
])
.pipe(gulpIgnore.exclude([
'node_modules/**',
'demo-output/**'
]))
.pipe(jscs());
});
gulp.task('jscs', function() {
return gulp.src([
'**/*.js'
])
...
.pipe(plumber())
.pipe(jscs());
});