refactor: 🚨 Turn every linter rule on and fix issues (there were a LOT :3)

This commit is contained in:
Jesse Wierzbinski 2024-06-12 16:26:43 -10:00
parent 2e98859153
commit a1e02d0d78
No known key found for this signature in database
177 changed files with 1826 additions and 1248 deletions

View file

@ -2,7 +2,7 @@ import { consoleLogger } from "@/loggers";
import { Command } from "@oclif/core";
import { setupDatabase } from "~/drizzle/db";
export abstract class BaseCommand<T extends typeof Command> extends Command {
export abstract class BaseCommand<_T extends typeof Command> extends Command {
protected async init(): Promise<void> {
await super.init();

View file

@ -2,7 +2,7 @@ import { Args } from "@oclif/core";
import chalk from "chalk";
import ora from "ora";
import { BaseCommand } from "~/cli/base";
import { getUrl } from "~/database/entities/Attachment";
import { getUrl } from "~/database/entities/attachment";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";

View file

@ -5,7 +5,7 @@ import { lookup } from "mime-types";
import ora from "ora";
import { unzip } from "unzipit";
import { BaseCommand } from "~/cli/base";
import { getUrl } from "~/database/entities/Attachment";
import { getUrl } from "~/database/entities/attachment";
import { db } from "~/drizzle/db";
import { Emojis } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";

View file

@ -33,14 +33,14 @@ export default class Start extends BaseCommand<typeof Start> {
public async run(): Promise<void> {
const { flags } = await this.parse(Start);
const numCPUs = flags["all-threads"] ? os.cpus().length : flags.threads;
const numCpUs = flags["all-threads"] ? os.cpus().length : flags.threads;
// Check if index is a JS or TS file (depending on the environment)
const index = (await Bun.file("index.ts").exists())
? "index.ts"
: "index.js";
for (let i = 0; i < numCPUs; i++) {
for (let i = 0; i < numCpUs; i++) {
const args = ["bun", index];
if (i !== 0 || flags.silent) {
args.push("--silent");

View file

@ -137,7 +137,7 @@ export default class UserCreate extends BaseCommand<typeof UserCreate> {
),
);
if (!flags.format && !flags["set-password"]) {
if (!(flags.format || flags["set-password"])) {
const link = "";
this.log(