From 2da90b58e494025eec90d34b6695fbcb1d90b3f9 Mon Sep 17 00:00:00 2001 From: witzig Date: Thu, 15 Jun 2017 21:26:35 +0200 Subject: [PATCH] Satisfy new eslint indentation rule --- lib/db.js | 6 +++--- lib/file-helpers.js | 10 +++++----- lib/models/fields.js | 2 ++ lib/tools.js | 18 +++++++++--------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/db.js b/lib/db.js index 8d6fe5db..44f17b0f 100644 --- a/lib/db.js +++ b/lib/db.js @@ -43,9 +43,9 @@ if (config.redis && config.redis.enabled) { return setImmediate(() => callback()); } module.exports.redis.multi(). - lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)). - expire('mailtrain:cache:' + key, 24 * 3600). - exec(err => callback(err)); + lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)). + expire('mailtrain:cache:' + key, 24 * 3600). + exec(err => callback(err)); }; module.exports.getFromCache = (key, callback) => { diff --git a/lib/file-helpers.js b/lib/file-helpers.js index fdad5caf..deee31e1 100644 --- a/lib/file-helpers.js +++ b/lib/file-helpers.js @@ -4,11 +4,11 @@ const path = require('path'); function nameToFileName(name) { return name. - trim(). - toLowerCase(). - replace(/[ .+/]/g, '-'). - replace(/[^a-z0-9\-_]/gi, ''). - replace(/--*/g, '-'); + trim(). + toLowerCase(). + replace(/[ .+/]/g, '-'). + replace(/[^a-z0-9\-_]/gi, ''). + replace(/--*/g, '-'); } diff --git a/lib/models/fields.js b/lib/models/fields.js index 0e955ad8..bda2c1b2 100644 --- a/lib/models/fields.js +++ b/lib/models/fields.js @@ -398,6 +398,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => { // ignore missing values return; } + /* eslint-disable indent */ switch (field.type) { case 'text': case 'website': @@ -574,6 +575,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => { break; } } + /* eslint-enable indent */ }); return row; diff --git a/lib/tools.js b/lib/tools.js index 18787fc5..89ac47aa 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -35,12 +35,12 @@ module.exports = { function toDbKey(key) { return key. - replace(/[^a-z0-9\-_]/gi, ''). - replace(/\-+/g, '_'). - replace(/[A-Z]/g, c => '_' + c.toLowerCase()). - replace(/^_+|_+$/g, ''). - replace(/_+/g, '_'). - trim(); + replace(/[^a-z0-9\-_]/gi, ''). + replace(/\-+/g, '_'). + replace(/[A-Z]/g, c => '_' + c.toLowerCase()). + replace(/^_+|_+$/g, ''). + replace(/_+/g, '_'). + trim(); } function fromDbKey(key) { @@ -71,9 +71,9 @@ function convertKeys(obj, options) { function queryParams(obj) { return Object.keys(obj). - filter(key => key !== '_csrf'). - map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])). - join('&'); + filter(key => key !== '_csrf'). + map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])). + join('&'); } function createSlug(table, name, callback) {