From 798a101cfe2e5f673486504c355c6264658ddaed Mon Sep 17 00:00:00 2001 From: Konstantin Tarkus Date: Fri, 27 Feb 2015 23:09:32 +0300 Subject: [PATCH] Add JSCS config file Ref #71 --- .jscsrc | 8 ++++++++ gulpfile.js | 9 ++++++--- preprocessor.js | 2 +- webpack.config.js | 3 ++- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .jscsrc diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 000000000..e9fc06cf0 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,8 @@ +{ + "preset": "google", + "disallowSpacesInAnonymousFunctionExpression": null, + "validateLineBreaks": "LF", + "validateIndentation": 2, + "excludeFiles": ["build/**", "node_modules/**"], + "esprima": "esprima-fb" +} diff --git a/gulpfile.js b/gulpfile.js index f943d7958..2c1335aad 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -40,7 +40,9 @@ var browserSync; gulp.task('default', ['sync']); // Clean output directory -gulp.task('clean', del.bind(null, ['.tmp', 'build/*', '!build/.git'], {dot: true})); +gulp.task('clean', del.bind( + null, ['.tmp', 'build/*', '!build/.git'], {dot: true} +)); // 3rd party libraries gulp.task('vendor', function() { @@ -135,7 +137,7 @@ gulp.task('serve', ['build:watch'], function(cb) { var server = (function startup() { var child = cp.fork('build/server.js', { - env: assign({ NODE_ENV: 'development' }, process.env) + env: assign({NODE_ENV: 'development'}, process.env) }); child.once('message', function(message) { if (message.match(/^online$/)) { @@ -200,7 +202,8 @@ gulp.task('deploy', function() { } return gulp.src('build/**/*') - .pipe($.if('**/robots.txt', !argv.production ? $.replace('Disallow:', 'Disallow: /') : $.util.noop())) + .pipe($.if('**/robots.txt', !argv.production ? + $.replace('Disallow:', 'Disallow: /') : $.util.noop())) .pipe($.ghPages({ remoteUrl: 'https://github.com/{name}/{name}.github.io.git', branch: 'master' diff --git a/preprocessor.js b/preprocessor.js index eb5b46274..f23a0d9be 100644 --- a/preprocessor.js +++ b/preprocessor.js @@ -10,7 +10,7 @@ module.exports = { } // Ignore all files within node_modules if (filename.indexOf('node_modules') === -1) { - return babel.transform(src, { filename: filename }).code; + return babel.transform(src, {filename: filename}).code; } return src; } diff --git a/webpack.config.js b/webpack.config.js index 8839d8e3a..2cde7f945 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -65,7 +65,8 @@ var config = { }, { test: /\.less$/, - loader: 'style-loader!css-loader!' + AUTOPREFIXER_LOADER + '!less-loader' + loader: 'style-loader!css-loader!' + AUTOPREFIXER_LOADER + + '!less-loader' }, { test: /\.gif/,