Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

Commit

Permalink
Add eslint error checking w/ travis (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmavery committed Jun 7, 2018
1 parent dca1eb4 commit 9186d21
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "6"

script:
- npm run lint
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function loginHelper(appState, email, password, globalOptions, callback) {
.get("https://www.facebook.com/ajax/presence/reconnect.php", ctx.jar, form)
.then(utils.saveCookies(ctx.jar));
})
.then(function(res) {
.then(function(_res) {
log.info("login", 'Request to pull 1');
var form = {
channel : 'p_' + ctx.userID,
Expand Down
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated April 30th 2015.",
"scripts": {
"test": "mocha",
"lint": "./node_modules/.bin/eslint **.js",
"prettier": "prettier utils.js src/* --write"
},
"repository": {
Expand Down Expand Up @@ -31,6 +32,17 @@
},
"devDependencies": {
"mocha": "^2.2.5",
"prettier": "^1.11.1"
"prettier": "^1.11.1",
"eslint": "^4.19.1"
},
"eslintConfig": {
"env": { "es6": true, "node": true },
"extends": "eslint:recommended",
"parserOptions": { "sourceType": "module" },
"rules": {
"linebreak-style": [ "error", "unix" ],
"semi": [ "error", "always" ],
"no-unused-vars": [1, {"argsIgnorePattern": "^_"}]
}
}
}
4 changes: 2 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,8 @@ function parseAndCheckLogin(ctx, defaultFuncs, retryCount) {

// Update ttstamp since that depends on fb_dtsg
ctx.ttstamp = "2";
for (var i = 0; i < ctx.fb_dtsg.length; i++) {
ctx.ttstamp += ctx.fb_dtsg.charCodeAt(i);
for (var j = 0; j < ctx.fb_dtsg.length; j++) {
ctx.ttstamp += ctx.fb_dtsg.charCodeAt(j);
}
}
}
Expand Down

0 comments on commit 9186d21

Please sign in to comment.