diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 00000000..574655a0 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,5 @@ +{ + "preset": "airbnb", + + "validateIndentation": 2 +} diff --git a/gulpfile.js b/gulpfile.js index bf6809ff..d0342eb3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,7 @@ var gulp = require('gulp'), bower = require('gulp-bower'), mainBowerFiles = require('main-bower-files'), path = require('path'), + jscs = require('gulp-jscs'), styleguide = require('./lib/styleguide'), distPath = './lib/dist', configPath = util.env.config ? util.env.config.replace(/\/$/, '') : null, @@ -50,6 +51,11 @@ gulp.task('serve', function() { }); }); +gulp.task('jscs', function(){ + return gulp.src(['lib/*.js']) + .pipe(jscs()); +}); + gulp.task('styleguide', function() { return createStyleguide(); }); diff --git a/package.json b/package.json index 52d8a84a..604e7226 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ ], "repository": { "type": "git", - "url" : "https://github.com/SC5/sc5-styleguide.git" + "url": "https://github.com/SC5/sc5-styleguide.git" }, "main": "./lib/styleguide.js", "dependencies": { @@ -52,8 +52,10 @@ "yargs": "^1.3.1" }, "devDependencies": { + "gulp-jscs": "^1.1.2", "gulp-jshint": "^1.8.4", "gulp-livereload": "^2.1.1", + "jscs": "^1.6.2", "tiny-lr": "^0.1.4" }, "scripts": {