diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 6eb8b7f7..00000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -build -# Hack fix to override default behavior for ignore files linted by name -# https://github.com/eslint/eslint/issues/15010 -!.* diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 7b0c4434..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @type {import('@types/eslint').Linter.BaseConfig} - */ -module.exports = { - extends: [ - "@remix-run/eslint-config", - "@remix-run/eslint-config/node", - "@remix-run/eslint-config/jest-testing-library", - "prettier", - ], - // we're using vitest which has a very similar API to jest - // (so the linting plugins work nicely), but it we have to explicitly - // set the jest version. - settings: { - jest: { - version: 27, - }, - }, - rules: { - "react/style-prop-object": 0, - }, -}; diff --git a/.gitignore b/.gitignore index 1a66c0f9..d5d5c9c3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,5 @@ yarn.lock *.log k8s-context *.sqlite3 -/cypress/screenshots -/cypress/videos tsconfig.tsbuildinfo +.react-router diff --git a/.husky/pre-push b/.husky/pre-push index f0bc84ea..ac246e56 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,2 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" npm run validate diff --git a/.lintstagedrc.js b/.lintstagedrc.js index a78214d0..aca557a2 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,4 +1,4 @@ -module.exports = { +export default { "**/*.[tj]s?(x)": ["eslint --fix --max-warnings=0", "prettier --check"], "migrations/*.[tj]s": [ "npm run start:migrate", diff --git a/Dockerfile b/Dockerfile index a5218419..02c31a4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app COPY package.json package-lock.json ./ RUN npm install -COPY remix.config.js tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./ +COPY vite.config.ts tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./ COPY app ./app RUN npm run build @@ -20,7 +20,6 @@ ADD package.json package-lock.json ./ RUN npm prune --production COPY --from=build /app/build ./build -COPY --from=build /app/public ./public COPY kysely.config.ts ./ COPY migrations ./migrations diff --git a/app/commands/convene.tsx b/app/commands/convene.tsx index 1ab45e27..b035a295 100644 --- a/app/commands/convene.tsx +++ b/app/commands/convene.tsx @@ -82,7 +82,7 @@ export const handler = async ( staff, extra: "✅ Restricted", }), - applyRestriction(message.member!), + applyRestriction(message.member), message.reply( "After a vote by the mods, this member has had restrictions applied to them", ), @@ -96,7 +96,7 @@ export const handler = async ( staff, extra: "✅ Kicked", }), - kick(message.member!), + kick(message.member), message.reply( "After a vote by the mods, this member has been kicked from the server to cool off", ), @@ -110,13 +110,13 @@ export const handler = async ( staff, extra: "✅ Banned", }), - ban(message.member!), + ban(message.member), message.reply( "After a vote by the mods, this member has been permanently banned", ), ]); return; - case resolutions.nudge: + case resolutions.nudge: { const [thread] = await Promise.all([ originalChannel.threads.create({ name: message.author.username, @@ -145,6 +145,7 @@ This isn't a formal warning, but your message concerned the moderators enough th ${quoteAndEscape(message.content)}`); return; + } case resolutions.warning: reportUser({ reason: ReportReasons.mod, @@ -172,7 +173,7 @@ This isn't a formal warning, but your message concerned the moderators enough th staff, extra: "✅ Timed out overnight", }); - timeout(message.member!); + timeout(message.member); return; } diff --git a/app/commands/reacord/ModResponse.tsx b/app/commands/reacord/ModResponse.tsx index e68fc7b5..ab484a0d 100644 --- a/app/commands/reacord/ModResponse.tsx +++ b/app/commands/reacord/ModResponse.tsx @@ -1,4 +1,4 @@ -import type { UserInfo } from "reacord"; +import type { ComponentEventUser } from "reacord"; import { Button } from "reacord"; import type { Resolution } from "~/helpers/modResponse"; @@ -17,7 +17,7 @@ export const ModResponse = ({ modRoleId, }: { votesRequired?: number; - onVote: (result: { vote: Resolution; user: UserInfo }) => void; + onVote: (result: { vote: Resolution; user: ComponentEventUser }) => void; onResolve: (result: Resolution) => Promise; modRoleId: string; }) => { diff --git a/app/commands/setupTickets.ts b/app/commands/setupTickets.ts index a7b885ea..9b2fe9ee 100644 --- a/app/commands/setupTickets.ts +++ b/app/commands/setupTickets.ts @@ -15,7 +15,7 @@ import { import { REST } from "@discordjs/rest"; import { Routes, TextInputStyle } from "discord-api-types/v10"; -import { discordToken } from "~/helpers/env"; +import { discordToken } from "~/helpers/env.server"; import { SETTINGS, fetchSettings } from "~/models/guilds.server"; import { format } from "date-fns"; import type { @@ -114,7 +114,7 @@ export default [ await thread.send({ content: "When you’ve finished, please close the ticket.", components: [ - // @ts-ignore + // @ts-expect-error Types for this are super busted new ActionRowBuilder().addComponents( new ButtonBuilder() .setCustomId(`close-ticket||${user.id}`) diff --git a/app/components/login.tsx b/app/components/login.tsx index 80082325..b9acffd3 100644 --- a/app/components/login.tsx +++ b/app/components/login.tsx @@ -1,4 +1,4 @@ -import { Form } from "@remix-run/react"; +import { Form } from "react-router"; import type { ButtonHTMLAttributes } from "react"; interface LoginProps extends ButtonHTMLAttributes { @@ -8,7 +8,7 @@ interface LoginProps extends ButtonHTMLAttributes { export function Login({ children = "Log in with Discord", - errors, + // errors, redirectTo, ...props }: LoginProps) { diff --git a/app/components/logout.tsx b/app/components/logout.tsx index bad07556..a29e919c 100644 --- a/app/components/logout.tsx +++ b/app/components/logout.tsx @@ -1,17 +1,9 @@ -import { Form } from "@remix-run/react"; +import { Form } from "react-router"; import type { ButtonHTMLAttributes } from "react"; -interface LoginProps extends ButtonHTMLAttributes { - errors?: { [k: string]: string }; - redirectTo?: string; -} +type LoginProps = ButtonHTMLAttributes; -export function Logout({ - children = "Log out", - errors, - redirectTo, - ...props -}: LoginProps) { +export function Logout({ children = "Log out", ...props }: LoginProps) { return (