Skip to content

Commit

Permalink
chore(deps): update dependency @nhcarrigan/eslint-config to v5.1.0 (#435
Browse files Browse the repository at this point in the history
)

* chore(deps): update dependency @nhcarrigan/eslint-config to v5.1.0

* chore: resolve linter issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Naomi Carrigan <[email protected]>
  • Loading branch information
renovate[bot] and naomi-lgbt authored Jan 7, 2025
1 parent 1930cf9 commit 18887c0
Show file tree
Hide file tree
Showing 9 changed files with 767 additions and 510 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"pnpm": "9"
},
"devDependencies": {
"@nhcarrigan/eslint-config": "5.0.0",
"@nhcarrigan/eslint-config": "5.1.0",
"@nhcarrigan/typescript-config": "4.0.0",
"@types/cli-progress": "3.11.6",
"@types/inquirer": "9.0.7",
Expand Down
1,239 changes: 750 additions & 489 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const isInScreenEnvironment = (): boolean => {
console.info(chalk.green(`Hello! Launching email blast application.`));
if (!isInScreenEnvironment()) {
throw new Error(
// eslint-disable-next-line stylistic/max-len
// eslint-disable-next-line stylistic/max-len -- This is a single string.
"You must run this script in a screen session to persist the process after closing the SSH connection.",
);
}
Expand All @@ -44,7 +44,7 @@ if (!isInScreenEnvironment()) {
const configuration = await getEnvironment();
if (!configuration.valid) {
throw new Error(
// eslint-disable-next-line stylistic/max-len
// eslint-disable-next-line stylistic/max-len -- This is a single string.
"Environment variables are not configured correctly. Please check the .env file.",
);
}
Expand Down Expand Up @@ -135,24 +135,20 @@ for (let index = 0; index < emailTotal; index = index + 1) {
if (!targetEmail) {
continue;
}
// eslint-disable-next-line no-await-in-loop
// eslint-disable-next-line no-await-in-loop -- I cannot run these concurrently or the API would shit itself at scale.
const status = await sendEmail(configuration, targetEmail, body);
if (!status.success) {
logStream.write(
`${status.status} - ${status.email} - ${status.logText}\n`,
failedBar.increment();
failureStream.write(
`${targetEmail.email},${targetEmail.unsubscribeId}\n`,
);
sentBar.increment();
continue;
}
failedBar.increment();
failureStream.write(
`${targetEmail.email},${targetEmail.unsubscribeId}\n`,
);
logStream.write(
`${status.status} - ${status.email} - ${status.logText}\n`,
);
sentBar.increment();
}

progress.stop();

console.info(chalk.green("Email blast complete! Have a nice day! :)"));
4 changes: 2 additions & 2 deletions src/modules/emailTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import chalk from "chalk";
import inquirer from "inquirer";
// eslint-disable-next-line @typescript-eslint/naming-convention
// eslint-disable-next-line @typescript-eslint/naming-convention -- Pascal Case because it's a class.
import Spinnies from "spinnies";
import { sendEmail } from "./sendEmail.js";
import type { ConfigInt } from "../interfaces/configInt.js";
Expand Down Expand Up @@ -36,7 +36,7 @@ const spinnies = new Spinnies({
* @param body - The email body text from getBody.
* @returns True if test is skipped, true if test succeeds, false if failed.
*/
// eslint-disable-next-line max-lines-per-function
// eslint-disable-next-line max-lines-per-function -- Will refactor at some point.
export const emailTest = async(
config: ConfigInt,
body: string,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/getBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { readFile } from "node:fs/promises";
import { join } from "node:path";
// eslint-disable-next-line @typescript-eslint/naming-convention
// eslint-disable-next-line @typescript-eslint/naming-convention -- Pascal Case because it's a class.
import Spinnies from "spinnies";

const spinnies = new Spinnies({
Expand Down
4 changes: 2 additions & 2 deletions src/modules/getEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import chalk from "chalk";
import inquirer from "inquirer";
// eslint-disable-next-line @typescript-eslint/naming-convention
// eslint-disable-next-line @typescript-eslint/naming-convention -- Pascal Case because it's a class.
import Spinnies from "spinnies";
import type { ConfigInt } from "../interfaces/configInt.js";

Expand All @@ -32,7 +32,7 @@ const spinnies = new Spinnies({
* @returns Returns the configuration object. The valid property is true
* on success, false on missing/invalid values.
*/
// eslint-disable-next-line max-lines-per-function, max-statements
// eslint-disable-next-line max-lines-per-function, max-statements -- Will refactor at some point.
export const getEnvironment = async(): Promise<ConfigInt> => {
const results: ConfigInt = {
accessKeyId: "",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/getValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { readFile } from "node:fs/promises";
import { join } from "node:path";
// eslint-disable-next-line @typescript-eslint/naming-convention
// eslint-disable-next-line @typescript-eslint/naming-convention -- Pascal Case because it's a class.
import Spinnies from "spinnies";
import type { EmailInt } from "../interfaces/emailInt.js";

Expand Down
4 changes: 2 additions & 2 deletions src/modules/sendEmail.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/naming-convention -- That one object is an underscore mess thanks to AWS. */
/**
* @copyright nhcarrigan
* @license Naomi's Public License
Expand All @@ -23,7 +23,7 @@ import type { SendReportInt } from "../interfaces/sendReportInt.js";
* @param body - The email body text from emailBody.txt.
* @returns Returns SendReportInt.
*/
// eslint-disable-next-line max-lines-per-function
// eslint-disable-next-line max-lines-per-function -- Will refactor at some point.
export const sendEmail = async(
config: ConfigInt,
email: EmailInt,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/barFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { Options, Params } from "cli-progress";
* @param payload - The progress bar payload object.
* @returns The formatted progress bar.
*/
// eslint-disable-next-line complexity, max-lines-per-function
// eslint-disable-next-line complexity, max-lines-per-function -- Will refactor at some point.
export const barFormatter = (
options: Options,
parameters: Params,
Expand Down

0 comments on commit 18887c0

Please sign in to comment.