chore: add linting, fix lint issues
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
"package": "git checkout -B package-lib && npm run build && git add -f lib && git commit -m 'package lib' && echo Use npm to tag and publish",
|
"package": "git checkout -B package-lib && npm run build && git add -f lib && git commit -m 'package lib' && echo Use npm to tag and publish",
|
||||||
"prepublish": "in-publish && npm run test || not-in-publish",
|
"prepublish": "in-publish && npm run test || not-in-publish",
|
||||||
"test": "retire -n -p package.json && npm run build && npm run unit",
|
"test": "retire -n -p package.json && npm run build && npm run unit",
|
||||||
|
"lint": "eslint \"*.js\" \"src/**/*.js\"",
|
||||||
"unit": "nyc --require babel-core/register mocha test/src/**"
|
"unit": "nyc --require babel-core/register mocha test/src/**"
|
||||||
},
|
},
|
||||||
"author": "Joe Fleming (https://github.com/w33ble)",
|
"author": "Joe Fleming (https://github.com/w33ble)",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default function createClient(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
};
|
}
|
||||||
|
|
||||||
export function isClient(client) {
|
export function isClient(client) {
|
||||||
// if there's a transport property, assume it's a client instance
|
// if there's a transport property, assume it's a client instance
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export function WorkerTimeoutError(message, props = {}) {
|
|||||||
this.timeout = props.timeout;
|
this.timeout = props.timeout;
|
||||||
this.jobId = props.jobId;
|
this.jobId = props.jobId;
|
||||||
|
|
||||||
if ("captureStackTrace" in Error) Error.captureStackTrace(this, WorkerTimeoutError);
|
if ('captureStackTrace' in Error) Error.captureStackTrace(this, WorkerTimeoutError);
|
||||||
else this.stack = (new Error()).stack;
|
else this.stack = (new Error()).stack;
|
||||||
}
|
}
|
||||||
WorkerTimeoutError.prototype = Object.create(Error.prototype);
|
WorkerTimeoutError.prototype = Object.create(Error.prototype);
|
||||||
@@ -14,7 +14,7 @@ export function UnspecifiedWorkerError(message, props = {}) {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
this.jobId = props.jobId;
|
this.jobId = props.jobId;
|
||||||
|
|
||||||
if ("captureStackTrace" in Error) Error.captureStackTrace(this, UnspecifiedWorkerError);
|
if ('captureStackTrace' in Error) Error.captureStackTrace(this, UnspecifiedWorkerError);
|
||||||
else this.stack = (new Error()).stack;
|
else this.stack = (new Error()).stack;
|
||||||
}
|
}
|
||||||
UnspecifiedWorkerError.prototype = Object.create(Error.prototype);
|
UnspecifiedWorkerError.prototype = Object.create(Error.prototype);
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ export default class Worker extends events.EventEmitter {
|
|||||||
bool: {
|
bool: {
|
||||||
filter: { term: { jobtype: this.jobtype } },
|
filter: { term: { jobtype: this.jobtype } },
|
||||||
should: [
|
should: [
|
||||||
{ term: { status: 'pending'} },
|
{ term: { status: 'pending' } },
|
||||||
{ bool:
|
{ bool:
|
||||||
{ filter: [
|
{ filter: [
|
||||||
{ term: { status: 'processing' } },
|
{ term: { status: 'processing' } },
|
||||||
@@ -345,8 +345,8 @@ export default class Worker extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sort: [
|
sort: [
|
||||||
{ priority: { order: 'asc' }},
|
{ priority: { order: 'asc' } },
|
||||||
{ created_at: { order: 'asc' }}
|
{ created_at: { order: 'asc' } }
|
||||||
],
|
],
|
||||||
size: this.checkSize
|
size: this.checkSize
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user