From 9a93be2752ec81ed1f634adbb63aef2d1c5272de Mon Sep 17 00:00:00 2001 From: Vijay A Date: Wed, 19 May 2021 11:28:09 +0530 Subject: Applied linter fixes. --- app/Controllers/Http/DashboardController.js | 11 ++++++----- app/Controllers/Http/ServiceController.js | 1 + app/Controllers/Http/StaticController.js | 9 +++++---- app/Controllers/Http/UserController.js | 11 ++++++----- app/Controllers/Http/WorkspaceController.js | 3 ++- 5 files changed, 20 insertions(+), 15 deletions(-) (limited to 'app/Controllers/Http') diff --git a/app/Controllers/Http/DashboardController.js b/app/Controllers/Http/DashboardController.js index 2f06961..a588c75 100644 --- a/app/Controllers/Http/DashboardController.js +++ b/app/Controllers/Http/DashboardController.js @@ -63,7 +63,8 @@ class DashboardController { } try { await Persona.forgotPassword(request.input('mail')); - } catch(e) {} + // eslint-disable-next-line no-empty + } catch (e) {} return view.render('others.message', { heading: 'Reset password', @@ -91,11 +92,11 @@ class DashboardController { const payload = { password: crypto.createHash('sha256').update(request.input('password')).digest('base64'), password_confirmation: crypto.createHash('sha256').update(request.input('password_confirmation')).digest('base64'), - } + }; try { await Persona.updatePasswordByToken(request.input('token'), payload); - } catch(e) { + } catch (e) { return view.render('others.message', { heading: 'Cannot reset your password', text: 'Please make sure you are using a valid and recent link to reset your password and that your passwords entered match.', @@ -122,7 +123,7 @@ class DashboardController { return view.render('dashboard.account', { username: auth.user.username, email: auth.user.email, - lastname: auth.user.lastname + lastname: auth.user.lastname, }); } @@ -136,7 +137,7 @@ class DashboardController { let validation = await validateAll(request.all(), { username: 'required', email: 'required', - lastname: 'required' + lastname: 'required', }); if (validation.fails()) { session.withErrors(validation.messages()).flashExcept(['password']); diff --git a/app/Controllers/Http/ServiceController.js b/app/Controllers/Http/ServiceController.js index a1d26cb..05d093b 100644 --- a/app/Controllers/Http/ServiceController.js +++ b/app/Controllers/Http/ServiceController.js @@ -140,6 +140,7 @@ class ServiceController { let iconId; do { iconId = uuid() + uuid(); + // eslint-disable-next-line no-await-in-loop } while (await fs.exists(path.join(Helpers.tmpPath('uploads'), iconId))); await icon.move(Helpers.tmpPath('uploads'), { diff --git a/app/Controllers/Http/StaticController.js b/app/Controllers/Http/StaticController.js index d1a1179..114e369 100644 --- a/app/Controllers/Http/StaticController.js +++ b/app/Controllers/Http/StaticController.js @@ -34,7 +34,6 @@ class StaticController { defaultTrialPlan: 'franz-pro-yearly', subscribeURL: 'https://getferdi.com', planSelectionURL: 'https://getferdi.com', - isMagicBarEnabled: true, hasInlineCheckout: true, isPlanSelectionEnabled: false, isTrialStatusBarEnabled: false, @@ -101,9 +100,11 @@ class StaticController { }) { return response.send( fs - .readJsonSync(path.join( - Helpers.appRoot(), "officialrecipes", "recipes", "all.json")) - .filter((recipe) => recipe.featured)); + .readJsonSync(path.join( + Helpers.appRoot(), 'officialrecipes', 'recipes', 'all.json', + )) + .filter((recipe) => recipe.featured), + ); } // Show announcements diff --git a/app/Controllers/Http/UserController.js b/app/Controllers/Http/UserController.js index e19e15e..0d768a9 100644 --- a/app/Controllers/Http/UserController.js +++ b/app/Controllers/Http/UserController.js @@ -177,6 +177,7 @@ class UserController { ...request.all(), }; + // eslint-disable-next-line no-param-reassign auth.user.settings = JSON.stringify(newSettings); await auth.user.save(); @@ -249,7 +250,7 @@ class UserController { email, password: hashedPassword, username: 'Franz', - lastname: 'Franz' + lastname: 'Franz', }); return response.send('Your account has been created but due to this server\'s configuration, we could not import your Franz account data.\n\nIf you are the server owner, please set CONNECT_WITH_FRANZ to true to enable account imports.'); @@ -263,7 +264,7 @@ class UserController { try { const basicToken = btoa(`${email}:${hashedPassword}`); const loginBody = { - isZendeskLogin: false + isZendeskLogin: false, }; const rawResponse = await fetch(`${base}auth/login`, { @@ -273,8 +274,8 @@ class UserController { Authorization: `Basic ${basicToken}`, 'User-Agent': userAgent, 'Content-Type': 'application/json', - 'accept': '*/*', - 'x-franz-source': 'Web' + accept: '*/*', + 'x-franz-source': 'Web', }, }); const content = await rawResponse.json(); @@ -312,7 +313,7 @@ class UserController { email: userInf.email, password: hashedPassword, username: userInf.firstname, - lastname: userInf.lastname + lastname: userInf.lastname, }); } catch (e) { const errorMessage = `Could not create your user in our system.\nError: ${e}`; diff --git a/app/Controllers/Http/WorkspaceController.js b/app/Controllers/Http/WorkspaceController.js index cbb6873..496912e 100644 --- a/app/Controllers/Http/WorkspaceController.js +++ b/app/Controllers/Http/WorkspaceController.js @@ -112,7 +112,8 @@ class WorkspaceController { } async delete({ - request, + // eslint-disable-next-line no-unused-vars + _request, response, auth, params, -- cgit v1.2.3-70-g09d2