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

Commit

Permalink
Use ESLint too, and start to use it on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ficristo committed Sep 10, 2016
1 parent 5ed3d67 commit 8cbe3a1
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 12 deletions.
10 changes: 9 additions & 1 deletion .brackets.json
Expand Up @@ -4,11 +4,19 @@
"plusplus": true,
"devel": true,
"nomen": true,
"indent": 4,
"maxerr": 50,
"es5": true,
"node": true
"node": true,
"regexp": true
},
"defaultExtension": "js",
"language": {
"javascript": {
"linting.prefer": ["ESLint", "JSLint"],
"linting.usePreferredOnly": true
}
},
"spaceUnits": 4,
"useTabChar": false
}
46 changes: 46 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,46 @@
{
"env": {
"node": true
},
"rules": {
"no-bitwise": 2,
"curly": 2,
"eqeqeq": 2,
"guard-for-in": 0,
"wrap-iife": [2, "outside"],
"no-use-before-define": 2,
"new-cap": 2,
"no-caller": 2,
"no-empty": 2,
"no-new": 2,
"no-invalid-regexp": 2,
"no-control-regex": 2,
"no-regex-spaces": 2,
"no-undef": 2,
"strict": 2,
"no-unused-vars": [0, {"vars": "all", "args": "none"}],
"semi": 2,

"no-iterator": 2,
"no-loop-func": 2,
"no-multi-str": 2,
"no-fallthrough": 2,
"no-proto": 2,
"no-script-url": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-new-require": 2,
"new-parens": 2,
"no-new-object": 2,
"no-invalid-this": 0,
"indent": [2, 4],

"valid-jsdoc": 0,
"valid-typeof": 2,

"no-trailing-spaces": [0, { "skipBlankLines": true }],
"eol-last": 2
}
}
2 changes: 1 addition & 1 deletion lib/downloadData.js
Expand Up @@ -50,4 +50,4 @@ function _collectDownloadedData(req, res) {
}
}

exports.collectDownloadedData = _collectDownloadedData;
exports.collectDownloadedData = _collectDownloadedData;
2 changes: 1 addition & 1 deletion lib/filestorage.js
Expand Up @@ -115,4 +115,4 @@ FileStorage.prototype = {
}
};

exports.Storage = FileStorage;
exports.Storage = FileStorage;
2 changes: 1 addition & 1 deletion lib/ramstorage.js
Expand Up @@ -77,4 +77,4 @@ RAMStorage.prototype = {
}
};

exports.Storage = RAMStorage;
exports.Storage = RAMStorage;
4 changes: 2 additions & 2 deletions lib/registry_utils.js
Expand Up @@ -125,12 +125,12 @@ exports.authorInfo = function () {
*
* @return {string} An URI to download the extension
*/
exports.formatDownloadURL = function(baseURL, name, version) {
exports.formatDownloadURL = function (baseURL, name, version) {
var urlEncodedName = encodeURIComponent(name),
urlEncodedNameAndVersion = encodeURIComponent(name + "-" + version + ".zip");

return baseURL + "/" + urlEncodedName + "/" + urlEncodedNameAndVersion;
}
};

/**
* Returns an array of current registry entries, sorted by the publish date of the latest version of each entry.
Expand Down
2 changes: 1 addition & 1 deletion lib/s3storage.js
Expand Up @@ -200,4 +200,4 @@ S3Storage.prototype = {
}
};

exports.Storage = S3Storage;
exports.Storage = S3Storage;
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -7,8 +7,9 @@
"scripts": {
"preinstall": "npm install deps/*",
"start": "node app",
"test": "istanbul test node_modules/jasmine-node/bin/jasmine-node spec",
"jslint": "./node_modules/.bin/jslint ./downloadStats/*.js ./spec/*.js ./lib/*.js"
"lint": "eslint ./downloadStats/*.js ./spec/*.js ./lib/*.js ./public/js/main.js",
"pretest": "npm run lint",
"test": "istanbul test node_modules/jasmine-node/bin/jasmine-node spec"
},
"issues": {
"url": "http://github.com/adobe/brackets-registry/issues"
Expand Down Expand Up @@ -39,10 +40,10 @@
"commander": "~2.1.0"
},
"devDependencies": {
"eslint": "~2.13.1",
"fs-extra": "~0.30.0",
"istanbul": "~0.4.5",
"jasmine-node": "~1.14.5",
"jslint": "~0.5.0",
"rewire": "~2.5.2"
}
}
6 changes: 6 additions & 0 deletions public/js/.eslintrc.json
@@ -0,0 +1,6 @@
{
"extends": "../../.eslintrc.json",
"env": {
"node": false
}
}
2 changes: 1 addition & 1 deletion spec/logfileProcessor.spec.js
Expand Up @@ -296,4 +296,4 @@ describe("LogfileProcessor", function () {
});
});
});
});
});
2 changes: 1 addition & 1 deletion spec/logging.spec.js
Expand Up @@ -176,4 +176,4 @@ describe("Error Reporter", function () {
done();
}, 25);
});
});
});

0 comments on commit 8cbe3a1

Please sign in to comment.