From 5255e3cb34c264160ecfa5823f03f7bd6e10641b Mon Sep 17 00:00:00 2001 From: Manuel Calavera Date: Thu, 17 Oct 2019 14:08:37 -0700 Subject: [PATCH] fix: linter --- api/loaders/accounts/index.js | 14 ++++++++++++-- api/loaders/applications/index.js | 14 ++++++++++++-- api/loaders/recency.js | 14 ++++++++++++-- api/network-explorer.js | 12 ++---------- src/v2/api/accounts.js | 2 +- .../Dashboard/NetworkOverview/StatCards/styles.js | 2 +- 6 files changed, 40 insertions(+), 18 deletions(-) diff --git a/api/loaders/accounts/index.js b/api/loaders/accounts/index.js index ea622cb0..237f199b 100644 --- a/api/loaders/accounts/index.js +++ b/api/loaders/accounts/index.js @@ -21,9 +21,19 @@ function parseAccountEntry(data) { * @returns {Promise<{timelinePage: *, timelineInfo: *}>} */ export async function loadAccountIndex(redisX, start, count, direction) { - const timelineInfo = await getRecencySetInfo(redisX, 'accounts', parseAccountEntry); + const timelineInfo = await getRecencySetInfo( + redisX, + 'accounts', + parseAccountEntry, + ); - const timelinePage = await getRecencySetPage(redisX, 'accounts', start, count, direction); + const timelinePage = await getRecencySetPage( + redisX, + 'accounts', + start, + count, + direction, + ); return { timelineInfo, diff --git a/api/loaders/applications/index.js b/api/loaders/applications/index.js index 875b6636..abe2dd27 100644 --- a/api/loaders/applications/index.js +++ b/api/loaders/applications/index.js @@ -21,9 +21,19 @@ function parseApplicationEntry(data) { * @returns {Promise<{timelinePage: *, timelineInfo: *}>} */ export async function loadApplicationIndex(redisX, start, count, direction) { - const timelineInfo = await getRecencySetInfo(redisX, 'applications', parseApplicationEntry); + const timelineInfo = await getRecencySetInfo( + redisX, + 'applications', + parseApplicationEntry, + ); - const timelinePage = await getRecencySetPage(redisX, 'applications', start, count, direction); + const timelinePage = await getRecencySetPage( + redisX, + 'applications', + start, + count, + direction, + ); return { timelineInfo, diff --git a/api/loaders/recency.js b/api/loaders/recency.js index e5ec4203..70d6fabe 100644 --- a/api/loaders/recency.js +++ b/api/loaders/recency.js @@ -11,7 +11,11 @@ export const DEFAULT_PAGE_SIZE = 100; * @param parseFunction * @returns {Promise<{dt: *, last: *, count: *, timeline: *, first: *}>} */ -export async function getRecencySetInfo(redisX, timeline, parseFunction = (x) => x) { +export async function getRecencySetInfo( + redisX, + timeline, + parseFunction = x => x, +) { const timelineKey = `!__recent:${timeline}`; const thePromise = new Promise((resolve, reject) => { @@ -64,7 +68,13 @@ export async function getRecencySetInfo(redisX, timeline, parseFunction = (x) => * @param direction * @returns {Promise<{next: *, dt: *, prev: *, start: *, length: *, count: *, timeline: *, results: *}>} */ -export async function getRecencySetPage(redisX, timeline, start, count, direction) { +export async function getRecencySetPage( + redisX, + timeline, + start, + count, + direction, +) { const timelineKey = `!__recent:${timeline}`; const safeCount = Math.min(MAX_PAGE_SIZE, Math.max(0, count)); const safeStart = start ? parseInt(start) : 0; diff --git a/api/network-explorer.js b/api/network-explorer.js index e5dea600..6fdb150d 100644 --- a/api/network-explorer.js +++ b/api/network-explorer.js @@ -193,11 +193,7 @@ export function addNetworkExplorerRoutes(redisX, app) { const count = q.count ? parseInt(q.count) : DEFAULT_PAGE_SIZE; const direction = q.direction || '-'; const {__errors__, rawData} = await new FriendlyGet() - .with( - 'rawData', - loadAccountIndex(redisX, start, count, direction), - {}, - ) + .with('rawData', loadAccountIndex(redisX, start, count, direction), {}) .get(); res.send( @@ -214,11 +210,7 @@ export function addNetworkExplorerRoutes(redisX, app) { const version = q.v || 'AccountDetailView@latest'; const {__errors__, rawData} = await new FriendlyGet() - .with( - 'rawData', - loadAccountDetail(redisX, req.params.id, version), - {}, - ) + .with('rawData', loadAccountDetail(redisX, req.params.id, version), {}) .get(); res.send( diff --git a/src/v2/api/accounts.js b/src/v2/api/accounts.js index da2cf7f3..eeca4db3 100644 --- a/src/v2/api/accounts.js +++ b/src/v2/api/accounts.js @@ -9,7 +9,7 @@ const ACCOUNT_DETAIL_VERSION = 'AccountDetailView@1.0.0'; export function apiGetAccountDetail({accountId, version}) { return api( `/explorer/accounts/${encodeURIComponent(accountId)}?v=${version || - ACCOUNT_DETAIL_VERSION}`, + ACCOUNT_DETAIL_VERSION}`, ); } diff --git a/src/v2/components/Dashboard/NetworkOverview/StatCards/styles.js b/src/v2/components/Dashboard/NetworkOverview/StatCards/styles.js index d1f959e3..aa55ae48 100644 --- a/src/v2/components/Dashboard/NetworkOverview/StatCards/styles.js +++ b/src/v2/components/Dashboard/NetworkOverview/StatCards/styles.js @@ -39,6 +39,6 @@ export default makeStyles(theme => ({ borderRadius: 0, padding: 11, whiteSpace: 'nowrap', - maxWidth: '100%' + maxWidth: '100%', }, }));