Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 3ffa8f8

Browse files
authored
Merge pull request #72 from ficristo/eslint
Use ESLint too, and start to use it on travis
2 parents 5ed3d67 + 8cbe3a1 commit 3ffa8f8

11 files changed

+73
-12
lines changed

.brackets.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44
"plusplus": true,
55
"devel": true,
66
"nomen": true,
7+
"indent": 4,
78
"maxerr": 50,
89
"es5": true,
9-
"node": true
10+
"node": true,
11+
"regexp": true
1012
},
1113
"defaultExtension": "js",
14+
"language": {
15+
"javascript": {
16+
"linting.prefer": ["ESLint", "JSLint"],
17+
"linting.usePreferredOnly": true
18+
}
19+
},
1220
"spaceUnits": 4,
1321
"useTabChar": false
1422
}

.eslintrc.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"rules": {
6+
"no-bitwise": 2,
7+
"curly": 2,
8+
"eqeqeq": 2,
9+
"guard-for-in": 0,
10+
"wrap-iife": [2, "outside"],
11+
"no-use-before-define": 2,
12+
"new-cap": 2,
13+
"no-caller": 2,
14+
"no-empty": 2,
15+
"no-new": 2,
16+
"no-invalid-regexp": 2,
17+
"no-control-regex": 2,
18+
"no-regex-spaces": 2,
19+
"no-undef": 2,
20+
"strict": 2,
21+
"no-unused-vars": [0, {"vars": "all", "args": "none"}],
22+
"semi": 2,
23+
24+
"no-iterator": 2,
25+
"no-loop-func": 2,
26+
"no-multi-str": 2,
27+
"no-fallthrough": 2,
28+
"no-proto": 2,
29+
"no-script-url": 2,
30+
"no-shadow": 0,
31+
"no-shadow-restricted-names": 2,
32+
"no-new-func": 2,
33+
"no-new-wrappers": 2,
34+
"no-new-require": 2,
35+
"new-parens": 2,
36+
"no-new-object": 2,
37+
"no-invalid-this": 0,
38+
"indent": [2, 4],
39+
40+
"valid-jsdoc": 0,
41+
"valid-typeof": 2,
42+
43+
"no-trailing-spaces": [0, { "skipBlankLines": true }],
44+
"eol-last": 2
45+
}
46+
}

lib/downloadData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ function _collectDownloadedData(req, res) {
5050
}
5151
}
5252

53-
exports.collectDownloadedData = _collectDownloadedData;
53+
exports.collectDownloadedData = _collectDownloadedData;

lib/filestorage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ FileStorage.prototype = {
115115
}
116116
};
117117

118-
exports.Storage = FileStorage;
118+
exports.Storage = FileStorage;

lib/ramstorage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ RAMStorage.prototype = {
7777
}
7878
};
7979

80-
exports.Storage = RAMStorage;
80+
exports.Storage = RAMStorage;

lib/registry_utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ exports.authorInfo = function () {
125125
*
126126
* @return {string} An URI to download the extension
127127
*/
128-
exports.formatDownloadURL = function(baseURL, name, version) {
128+
exports.formatDownloadURL = function (baseURL, name, version) {
129129
var urlEncodedName = encodeURIComponent(name),
130130
urlEncodedNameAndVersion = encodeURIComponent(name + "-" + version + ".zip");
131131

132132
return baseURL + "/" + urlEncodedName + "/" + urlEncodedNameAndVersion;
133-
}
133+
};
134134

135135
/**
136136
* Returns an array of current registry entries, sorted by the publish date of the latest version of each entry.

lib/s3storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ S3Storage.prototype = {
200200
}
201201
};
202202

203-
exports.Storage = S3Storage;
203+
exports.Storage = S3Storage;

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"scripts": {
88
"preinstall": "npm install deps/*",
99
"start": "node app",
10-
"test": "istanbul test node_modules/jasmine-node/bin/jasmine-node spec",
11-
"jslint": "./node_modules/.bin/jslint ./downloadStats/*.js ./spec/*.js ./lib/*.js"
10+
"lint": "eslint ./downloadStats/*.js ./spec/*.js ./lib/*.js ./public/js/main.js",
11+
"pretest": "npm run lint",
12+
"test": "istanbul test node_modules/jasmine-node/bin/jasmine-node spec"
1213
},
1314
"issues": {
1415
"url": "http://github.com/adobe/brackets-registry/issues"
@@ -39,10 +40,10 @@
3940
"commander": "~2.1.0"
4041
},
4142
"devDependencies": {
43+
"eslint": "~2.13.1",
4244
"fs-extra": "~0.30.0",
4345
"istanbul": "~0.4.5",
4446
"jasmine-node": "~1.14.5",
45-
"jslint": "~0.5.0",
4647
"rewire": "~2.5.2"
4748
}
4849
}

public/js/.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../../.eslintrc.json",
3+
"env": {
4+
"node": false
5+
}
6+
}

spec/logfileProcessor.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,4 @@ describe("LogfileProcessor", function () {
296296
});
297297
});
298298
});
299-
});
299+
});

0 commit comments

Comments
 (0)