diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..9ac20df --- /dev/null +++ b/.jscsrc @@ -0,0 +1,17 @@ +{ + "validateIndentation": 2, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "disallowQuotedKeysInObjects": true, + "disallowPaddingNewlinesInBlocks": true, + "disallowSpacesInFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "disallowMultipleLineStrings": true, + "disallowMultipleLineBreaks": true, + "disallowMultipleSpaces": true, + "requireLineFeedAtFileEnd": true, + "requireSemicolons": true, + "maximumLineLength": 120 +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..e10d992 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,5 @@ +{ + "node": true, + "latedef": true, + "undef": true +} diff --git a/index.js b/index.js index 818fbb4..8a2ceec 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ var cssLintPlugin = function(options) { if (file.isNull()) return cb(null, file); // pass along if (file.isStream()) return cb(new error('gulp-csslint: Streaming not supported')); - rcLoader.for(file.path, function (err, opts) { + rcLoader.for(file.path, function(err, opts) { if (err) return cb(err); var str = file.contents.toString('utf8'); @@ -122,8 +122,8 @@ cssLintPlugin.reporter = function(customReporter) { }); }; -cssLintPlugin.failReporter = function(){ - return es.map(function (file, cb) { +cssLintPlugin.failReporter = function() { + return es.map(function(file, cb) { // Nothing to report or no errors if (!file.csslint || file.csslint.success) { return cb(null, file); diff --git a/package.json b/package.json index c3c3927..8da566d 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,14 @@ "rcloader": "^0.1.4" }, "devDependencies": { + "jscs": "^1.12.0", + "jshint": "^2.6.3", "mocha": "^2.2.1", "should": "^5.2.0" }, "scripts": { + "lint": "jscs index.js test/ & jshint index.js test/", + "pretest": "npm run-script lint", "test": "mocha" }, "repository": { diff --git a/test/.jshintrc b/test/.jshintrc new file mode 100644 index 0000000..e26f0d4 --- /dev/null +++ b/test/.jshintrc @@ -0,0 +1,4 @@ +{ + "extends": "../.jshintrc", + "mocha": true +}