Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Commit

Permalink
Add JSCS and JSHint
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Mar 31, 2015
1 parent 32838e7 commit 6934624
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 5 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"node": true,
"latedef": true,
"undef": true
}
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions test/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../.jshintrc",
"mocha": true
}

0 comments on commit 6934624

Please sign in to comment.