From fc0bd9f07c5963cb5bf0f3fe579c15b14986fc12 Mon Sep 17 00:00:00 2001
From: ricardo <ricardoespinoza105@gmail.com>
Date: Thu, 28 Apr 2022 20:53:54 -0400
Subject: [PATCH] :zap: Fix linting issues

---
 .../cli/src/PublicApi/Services/execution.ts   |  2 +-
 packages/cli/src/PublicApi/helpers.ts         | 29 +++++++++----------
 packages/cli/src/UserManagement/routes/me.ts  |  3 +-
 3 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/packages/cli/src/PublicApi/Services/execution.ts b/packages/cli/src/PublicApi/Services/execution.ts
index 9b73255c79..0b67c3228f 100644
--- a/packages/cli/src/PublicApi/Services/execution.ts
+++ b/packages/cli/src/PublicApi/Services/execution.ts
@@ -1,4 +1,4 @@
-import { In, Equal, Not, ObjectLiteral, MoreThan, LessThan } from 'typeorm';
+import { In, Equal, Not, ObjectLiteral, LessThan } from 'typeorm';
 import { Db, IExecutionFlattedDb } from '../..';
 import { ExecutionStatus } from '../publicApiRequest';
 
diff --git a/packages/cli/src/PublicApi/helpers.ts b/packages/cli/src/PublicApi/helpers.ts
index a84b471d73..3e6080e463 100644
--- a/packages/cli/src/PublicApi/helpers.ts
+++ b/packages/cli/src/PublicApi/helpers.ts
@@ -1,6 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unsafe-member-access */
-/* eslint-disable @typescript-eslint/no-unsafe-call */
-/* eslint-disable @typescript-eslint/no-unsafe-assignment */
 /* eslint-disable import/no-cycle */
 // eslint-disable-next-line import/no-extraneous-dependencies
 import { pick } from 'lodash';
@@ -141,18 +138,20 @@ async function invite(
 			const resp: { success?: boolean; id?: string } = {};
 			// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
 			const inviteAcceptUrl = `${baseUrl}/signup?inviterId=${apiKeyOwnerId}&inviteeId=${user?.id}`;
-			const sentEmail = await mailer?.invite({
-				email: user!.email,
-				inviteAcceptUrl,
-				domain: baseUrl,
-			});
+			if (user?.email) {
+				const sentEmail = await mailer?.invite({
+					email: user.email,
+					inviteAcceptUrl,
+					domain: baseUrl,
+				});
 
-			if (sentEmail?.success) {
-				resp.success = true;
-				resp.id = user?.id;
-			} else {
-				resp.success = false;
-				resp.id = user?.id;
+				if (sentEmail?.success) {
+					resp.success = true;
+					resp.id = user?.id;
+				} else {
+					resp.success = false;
+					resp.id = user?.id;
+				}
 			}
 			return resp;
 		}),
@@ -333,7 +332,7 @@ export function clean(
 
 export async function authenticationHandler(
 	req: express.Request,
-	scopes: any,
+	scopes: unknown,
 	schema: OpenAPIV3.ApiKeySecurityScheme,
 ): Promise<boolean> {
 	const apiKey = req.headers[schema.name.toLowerCase()];
diff --git a/packages/cli/src/UserManagement/routes/me.ts b/packages/cli/src/UserManagement/routes/me.ts
index 39c954fd4d..943c676b7a 100644
--- a/packages/cli/src/UserManagement/routes/me.ts
+++ b/packages/cli/src/UserManagement/routes/me.ts
@@ -5,6 +5,7 @@ import express from 'express';
 import validator from 'validator';
 import { LoggerProxy as Logger } from 'n8n-workflow';
 
+import { randomBytes } from 'crypto';
 import { Db, InternalHooksManager, ResponseHelper } from '../..';
 import { issueCookie } from '../auth/jwt';
 import { N8nApp, PublicUser } from '../Interfaces';
@@ -12,8 +13,6 @@ import { validatePassword, sanitizeUser, compareHash, hashPassword } from '../Us
 import type { AuthenticatedRequest, MeRequest } from '../../requests';
 import { validateEntity } from '../../GenericHelpers';
 import { User } from '../../databases/entities/User';
-import { randomBytes } from 'crypto';
-import { userInfo } from 'os';
 
 export function meNamespace(this: N8nApp): void {
 	/**