Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
jshint & eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenedith committed Aug 7, 2016
1 parent bd289b4 commit e8499fa
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
node_modules
#config/runtime.json
config/runtimes.json
functionalTest
test
coverage
*.iml
*.ipr
*.iws
.idea
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
"key-spacing": [ 0 ],
"new-cap": [ 0 ],
"no-lonely-if": [ 0 ],
"no-multi-str": [ 0 ],
"no-underscore-dangle": [ 0 ],
"quotes": [ 0 ],
"semi": [ 0 ],
Expand Down
8 changes: 8 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# node_modules ignored by default
node_modules/

# other ignored directories
coverage/
test/
functionalTest
public
5 changes: 3 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bitwise": false,
"asi": false,
"browser": false,
"camelcase": false,
"camelcase": true,
"curly": true,
"devel": false,
"enforceall": true,
Expand Down Expand Up @@ -33,5 +33,6 @@
"undef": true,
"unused": true,
"maxlen": 140,
"latedef": true
"latedef": true,
"globals": { "JSON": true }
}
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

var meta = require('./lib/meta');
var logger = require('./lib/logger/logger').logger;
var ticketsClient = require('./lib/client/createTicket');
var updateTicketClient = require('./lib/client/updateTicket');
var getTicketClient = require('./lib/client/getTicket');
Expand Down
6 changes: 3 additions & 3 deletions lib/client/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var getTicketsRequest = function getTicketsRequest(jar, month, page, formConfig,
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on getTicketsRequest: ', error);
Expand Down Expand Up @@ -137,7 +137,7 @@ var handleReceiptsForMonth = function handleReceiptsForMonth(jar, month, formCon
var collection = [];
var page = 0;

async.forever(
return async.forever(
function (cb) {
page++;
buildList(jar, month, page, formConfig, function (err, list) {
Expand All @@ -164,7 +164,7 @@ var handleReceiptsForMonth = function handleReceiptsForMonth(jar, month, formCon
var handleReceipts = function handleReceipts(jar, formConfig, callback) {
logger.debug('handleReceipts');

async.map(
return async.map(
MONTHS,
function (month, cb) {
handleReceiptsForMonth(jar, month, formConfig, cb);
Expand Down
2 changes: 1 addition & 1 deletion lib/client/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var auth = function auth(jar, form, token, authRequestConfig, callback) {
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on auth: ', error);
Expand Down
6 changes: 3 additions & 3 deletions lib/client/createTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var sendLotteryTicketRequest = function sendLotteryTicketRequest(jar, token, cap
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on sendLotteryTicketRequest: ', error);
Expand Down Expand Up @@ -131,7 +131,7 @@ var sendCaptchaRequest = function sendCaptchaRequest(jar, token, captcha, captch
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on sendLotteryTicketRequest: ', error);
Expand Down Expand Up @@ -253,7 +253,7 @@ var sendLotteryTicket = function sendLotteryTicket(ticketRequest, options, callb
createTicketsRequestConfig = extend(createTicketsRequestConfig, {url: data.url});
}

sendCaptchaRequest(jar, data.token, data.captcha, captchaRequestConfig, function (captchaErr, captchBody) {
return sendCaptchaRequest(jar, data.token, data.captcha, captchaRequestConfig, function (captchaErr, captchBody) {
if (captchaErr) {
logger.error('sendCaptchaRequest returned with error: ', captchaErr);
return callback(captchaErr);
Expand Down
2 changes: 1 addition & 1 deletion lib/client/getTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var getLotteryTicketRequest = function getLotteryTicketRequest(jar, token, id, t
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on getLotteryTicketRequest: ', error);
Expand Down
2 changes: 1 addition & 1 deletion lib/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var getMainPage = function getMainPage(jar, options, callback) {
};

try {
request(opts, function (error, response, body) {
return request(opts, function (error, response, body) {
if (error) {
logger.info('error on getMainPage: ', error);
return callback(new ServiceUnavailableError('Unable to create receipt'));
Expand Down
4 changes: 2 additions & 2 deletions lib/client/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var getResultsRequest = function getResultsRequest(jar, page, formConfig, callba
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on getResultsRequest: ', error);
Expand Down Expand Up @@ -110,7 +110,7 @@ var handleResults = function handleResults(jar, formConfig, callback) {
var collection = [];
var page = 0;

async.forever(
return async.forever(
function (cb) {
page++;
buildList(jar, page, formConfig, function (err, list) {
Expand Down
2 changes: 1 addition & 1 deletion lib/client/updateTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var updateLotteryTicketRequest = function updateLotteryTicketRequest(jar, token,
};

try {
request(opt, function (error, response, body) {
return request(opt, function (error, response, body) {

if (error) {
logger.info('error on updateLotteryTicketRequest: ', error);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "receipts-lottery-client",
"version": "1.3.0",
"version": "1.3.1",
"description": "Receipts lottery client",
"main": "./index.js",
"dependencies": {
"assert-plus": "1.0.0",
"async": "2.0.1",
"cheerio": "0.20.0",
"moment-timezone": "0.5.5",
"receipts-model": "1.5.1",
"receipts-model": "1.5.3",
"request": "2.74.0",
"winston": "2.2.0",
"winston-loggly": "1.3.1"
Expand Down Expand Up @@ -45,6 +45,6 @@
"node": ">=6.2.1"
},
"readmeFilename": "README.md",
"_id": "receipts-lottery-client@1.3.0",
"_from": "receipts-lottery-client@^1.3.0"
"_id": "receipts-lottery-client@1.3.1",
"_from": "receipts-lottery-client@^1.3.1"
}

0 comments on commit e8499fa

Please sign in to comment.