Add eslint rule and fix as many issues as possible

This commit is contained in:
Khoa Le
2023-06-19 23:42:04 -04:00
parent e9eacc445d
commit 9d33e4756b
689 changed files with 9446 additions and 21821 deletions
+18 -18
View File
@@ -1,31 +1,31 @@
import nodemailer from 'nodemailer';
import nodemailer from "nodemailer";
import {
SMTP_HOST_SENDGRID,
SMTP_HOST_GMAIL,
SMTP_HOST_MAILGUN,
SMTP_HOST_SENDGRID,
SMTP_HOST_SOCKETLABS,
SMTP_HOST_ZOHOMAIL,
SMTP_HOST_GMAIL
} from '../variables';
import SMTPConnection from 'nodemailer/lib/smtp-connection';
import * as Sentry from '@sentry/node';
} from "../variables";
import SMTPConnection from "nodemailer/lib/smtp-connection";
import * as Sentry from "@sentry/node";
import {
getSmtpHost,
getSmtpUsername,
getSmtpPassword,
getSmtpPort,
getSmtpSecure,
getSmtpPort
} from '../config';
getSmtpUsername,
} from "../config";
export const initSmtp = async () => {
const mailOpts: SMTPConnection.Options = {
host: await getSmtpHost(),
port: await getSmtpPort()
port: await getSmtpPort(),
};
if ((await getSmtpUsername()) && (await getSmtpPassword())) {
mailOpts.auth = {
user: await getSmtpUsername(),
pass: await getSmtpPassword()
pass: await getSmtpPassword(),
};
}
@@ -37,31 +37,31 @@ export const initSmtp = async () => {
case SMTP_HOST_MAILGUN:
mailOpts.requireTLS = true;
mailOpts.tls = {
ciphers: 'TLSv1.2'
ciphers: "TLSv1.2",
}
break;
case SMTP_HOST_SOCKETLABS:
mailOpts.requireTLS = true;
mailOpts.tls = {
ciphers: 'TLSv1.2'
ciphers: "TLSv1.2",
}
break;
case SMTP_HOST_ZOHOMAIL:
mailOpts.requireTLS = true;
mailOpts.tls = {
ciphers: 'TLSv1.2'
ciphers: "TLSv1.2",
}
break;
case SMTP_HOST_GMAIL:
mailOpts.requireTLS = true;
mailOpts.tls = {
ciphers: 'TLSv1.2'
ciphers: "TLSv1.2",
}
break;
default:
if ((await getSmtpHost()).includes('amazonaws.com')) {
if ((await getSmtpHost()).includes("amazonaws.com")) {
mailOpts.tls = {
ciphers: 'TLSv1.2'
ciphers: "TLSv1.2",
}
} else {
mailOpts.secure = true;
@@ -75,7 +75,7 @@ export const initSmtp = async () => {
.verify()
.then((err) => {
Sentry.setUser(null);
Sentry.captureMessage('SMTP - Successfully connected');
Sentry.captureMessage("SMTP - Successfully connected");
console.log("SMTP - Successfully connected")
})
.catch(async (err) => {