Skip to content

Commit 44070e1

Browse files
committed
Merge pull request #22 from SimenB/linters
Add JSCS & JSHint
2 parents 32838e7 + 6934624 commit 44070e1

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

.jscsrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"validateIndentation": 2,
3+
"requireSpacesInFunctionExpression": {
4+
"beforeOpeningCurlyBrace": true
5+
},
6+
"disallowQuotedKeysInObjects": true,
7+
"disallowPaddingNewlinesInBlocks": true,
8+
"disallowSpacesInFunctionExpression": {
9+
"beforeOpeningRoundBrace": true
10+
},
11+
"disallowMultipleLineStrings": true,
12+
"disallowMultipleLineBreaks": true,
13+
"disallowMultipleSpaces": true,
14+
"requireLineFeedAtFileEnd": true,
15+
"requireSemicolons": true,
16+
"maximumLineLength": 120
17+
}

.jshintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"node": true,
3+
"latedef": true,
4+
"undef": true
5+
}

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var cssLintPlugin = function(options) {
5353
if (file.isNull()) return cb(null, file); // pass along
5454
if (file.isStream()) return cb(new error('gulp-csslint: Streaming not supported'));
5555

56-
rcLoader.for(file.path, function (err, opts) {
56+
rcLoader.for(file.path, function(err, opts) {
5757
if (err) return cb(err);
5858

5959
var str = file.contents.toString('utf8');
@@ -122,8 +122,8 @@ cssLintPlugin.reporter = function(customReporter) {
122122
});
123123
};
124124

125-
cssLintPlugin.failReporter = function(){
126-
return es.map(function (file, cb) {
125+
cssLintPlugin.failReporter = function() {
126+
return es.map(function(file, cb) {
127127
// Nothing to report or no errors
128128
if (!file.csslint || file.csslint.success) {
129129
return cb(null, file);

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
"rcloader": "^0.1.4"
1111
},
1212
"devDependencies": {
13+
"jscs": "^1.12.0",
14+
"jshint": "^2.6.3",
1315
"mocha": "^2.2.1",
1416
"should": "^5.2.0"
1517
},
1618
"scripts": {
19+
"lint": "jscs index.js test/ & jshint index.js test/",
20+
"pretest": "npm run-script lint",
1721
"test": "mocha"
1822
},
1923
"repository": {

test/.jshintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../.jshintrc",
3+
"mocha": true
4+
}

0 commit comments

Comments
 (0)