Skip to content

Commit

Permalink
Merge pull request #1025 from DoSomething/eslint
Browse files Browse the repository at this point in the history
Cache helper test + eslint update
  • Loading branch information
aaronschachter committed Mar 30, 2018
2 parents 104f758 + e7358e1 commit d0629b7
Show file tree
Hide file tree
Showing 11 changed files with 1,281 additions and 509 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
@@ -1,5 +1,5 @@
---
extends: "@dosomething/eslint-config"
extends: "@dosomething/eslint-config/nodejs/6.x"
globals:
app: true
parserOptions:
Expand Down
2 changes: 0 additions & 2 deletions app/exceptions/ClosedCampaignError.js
@@ -1,12 +1,10 @@
'use strict';

class ClosedCampaignError extends Error {

constructor(phoenixCampaign) {
super();
this.message = `Campaign ${phoenixCampaign.id} is closed.`;
}

}

module.exports = ClosedCampaignError;
2 changes: 0 additions & 2 deletions app/exceptions/UnprocessibleEntityError.js
@@ -1,12 +1,10 @@
'use strict';

class UnprocessibleEntityError extends Error {

constructor(message) {
super(message);
this.status = 422;
}

}

module.exports = UnprocessibleEntityError;
8 changes: 4 additions & 4 deletions lib/contentful.js
Expand Up @@ -72,8 +72,8 @@ module.exports.fetchSingleEntry = function fetchSingleEntry(query) {
return new Promise((resolve, reject) => {
logger.debug(`contentful.fetchSingleEntry:${JSON.stringify(query)}`);
return exports.getClient().getEntries(query)
.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
});
};

Expand Down Expand Up @@ -109,8 +109,8 @@ module.exports.fetchKeywords = function fetchKeywords() {
.environment(process.env.NODE_ENV)
.build();
return exports.getClient().getEntries(query)
.then(response => response.items.map(item => exports.formatKeywordFromResponse(item)))
.catch(error => exports.contentfulError(error));
.then(response => response.items.map(item => exports.formatKeywordFromResponse(item)))
.catch(error => exports.contentfulError(error));
};

module.exports.fetchKeywordsForCampaignId = function (campaignId) {
Expand Down
6 changes: 3 additions & 3 deletions lib/middleware/timeouts.js
Expand Up @@ -22,7 +22,7 @@ module.exports.injectTimeoutString = function injectTimeoutString(req, res, next
next();
};

// Set respond to false so we can send our own 504 status.
// Note: Our routes will need to check for req.timedout.
// @see https://github.com/expressjs/timeout/tree/v1.8.0#api
// Set respond to false so we can send our own 504 status.
// Note: Our routes will need to check for req.timedout.
// @see https://github.com/expressjs/timeout/tree/v1.8.0#api
module.exports.timedout = timeout(`${getTimeoutNumSeconds()}s`, { respond: false });
1 change: 0 additions & 1 deletion lib/tools/profiler.js
Expand Up @@ -7,7 +7,6 @@ const EventEmitter = require('events');
* The Profiler
*/
class Profiler extends EventEmitter {

/**
* Create a new Profiler.
*
Expand Down
1 change: 0 additions & 1 deletion lib/tools/uploader.js
Expand Up @@ -7,7 +7,6 @@ const s3Stream = require('s3-upload-stream');
* The S3Uploader class.
*/
class S3Uploader {

/**
* Create a new S3Uploader
*
Expand Down

0 comments on commit d0629b7

Please sign in to comment.