Skip to content

Commit c87ff82

Browse files
committed
Revert "Upgrade to react-router@7, eslint@9, version bump the rest (#101)"
This reverts commit 89f7ae2.
1 parent 89f7ae2 commit c87ff82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+33526
-12107
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
# Hack fix to override default behavior for ignore files linted by name
3+
# https://github.com/eslint/eslint/issues/15010
4+
!.*

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @type {import('@types/eslint').Linter.BaseConfig}
3+
*/
4+
module.exports = {
5+
extends: [
6+
"@remix-run/eslint-config",
7+
"@remix-run/eslint-config/node",
8+
"@remix-run/eslint-config/jest-testing-library",
9+
"prettier",
10+
],
11+
// we're using vitest which has a very similar API to jest
12+
// (so the linting plugins work nicely), but it we have to explicitly
13+
// set the jest version.
14+
settings: {
15+
jest: {
16+
version: 27,
17+
},
18+
},
19+
rules: {
20+
"react/style-prop-object": 0,
21+
},
22+
};

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ yarn.lock
1010
*.log
1111
k8s-context
1212
*.sqlite3
13+
/cypress/screenshots
14+
/cypress/videos
1315
tsconfig.tsbuildinfo
14-
.react-router

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
13

24
npm run validate

.lintstagedrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
module.exports = {
22
"**/*.[tj]s?(x)": ["eslint --fix --max-warnings=0", "prettier --check"],
33
"migrations/*.[tj]s": [
44
"npm run start:migrate",

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44
COPY package.json package-lock.json ./
55
RUN npm install
66

7-
COPY vite.config.ts tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./
7+
COPY remix.config.js tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./
88
COPY app ./app
99

1010
RUN npm run build
@@ -20,6 +20,7 @@ ADD package.json package-lock.json ./
2020
RUN npm prune --production
2121

2222
COPY --from=build /app/build ./build
23+
COPY --from=build /app/public ./public
2324

2425
COPY kysely.config.ts ./
2526
COPY migrations ./migrations

app/commands/convene.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const handler = async (
8282
staff,
8383
extra: "✅ Restricted",
8484
}),
85-
applyRestriction(message.member),
85+
applyRestriction(message.member!),
8686
message.reply(
8787
"After a vote by the mods, this member has had restrictions applied to them",
8888
),
@@ -96,7 +96,7 @@ export const handler = async (
9696
staff,
9797
extra: "✅ Kicked",
9898
}),
99-
kick(message.member),
99+
kick(message.member!),
100100
message.reply(
101101
"After a vote by the mods, this member has been kicked from the server to cool off",
102102
),
@@ -110,13 +110,13 @@ export const handler = async (
110110
staff,
111111
extra: "✅ Banned",
112112
}),
113-
ban(message.member),
113+
ban(message.member!),
114114
message.reply(
115115
"After a vote by the mods, this member has been permanently banned",
116116
),
117117
]);
118118
return;
119-
case resolutions.nudge: {
119+
case resolutions.nudge:
120120
const [thread] = await Promise.all([
121121
originalChannel.threads.create({
122122
name: message.author.username,
@@ -145,7 +145,6 @@ This isn't a formal warning, but your message concerned the moderators enough th
145145
146146
${quoteAndEscape(message.content)}`);
147147
return;
148-
}
149148
case resolutions.warning:
150149
reportUser({
151150
reason: ReportReasons.mod,
@@ -173,7 +172,7 @@ This isn't a formal warning, but your message concerned the moderators enough th
173172
staff,
174173
extra: "✅ Timed out overnight",
175174
});
176-
timeout(message.member);
175+
timeout(message.member!);
177176

178177
return;
179178
}

app/commands/reacord/ModResponse.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ComponentEventUser } from "reacord";
1+
import type { UserInfo } from "reacord";
22
import { Button } from "reacord";
33

44
import type { Resolution } from "~/helpers/modResponse";
@@ -17,7 +17,7 @@ export const ModResponse = ({
1717
modRoleId,
1818
}: {
1919
votesRequired?: number;
20-
onVote: (result: { vote: Resolution; user: ComponentEventUser }) => void;
20+
onVote: (result: { vote: Resolution; user: UserInfo }) => void;
2121
onResolve: (result: Resolution) => Promise<void>;
2222
modRoleId: string;
2323
}) => {

app/commands/setupTickets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import { REST } from "@discordjs/rest";
1616
import { Routes, TextInputStyle } from "discord-api-types/v10";
1717

18-
import { discordToken } from "~/helpers/env.server";
18+
import { discordToken } from "~/helpers/env";
1919
import { SETTINGS, fetchSettings } from "~/models/guilds.server";
2020
import { format } from "date-fns";
2121
import type {
@@ -114,7 +114,7 @@ export default [
114114
await thread.send({
115115
content: "When you’ve finished, please close the ticket.",
116116
components: [
117-
// @ts-expect-error Types for this are super busted
117+
// @ts-ignore
118118
new ActionRowBuilder().addComponents(
119119
new ButtonBuilder()
120120
.setCustomId(`close-ticket||${user.id}`)

app/components/login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Form } from "react-router";
1+
import { Form } from "@remix-run/react";
22
import type { ButtonHTMLAttributes } from "react";
33

44
interface LoginProps extends ButtonHTMLAttributes<Element> {
@@ -8,7 +8,7 @@ interface LoginProps extends ButtonHTMLAttributes<Element> {
88

99
export function Login({
1010
children = "Log in with Discord",
11-
// errors,
11+
errors,
1212
redirectTo,
1313
...props
1414
}: LoginProps) {

0 commit comments

Comments
 (0)