Skip to content

Commit 7efa8e8

Browse files
authored
Merge pull request #539 from cm-ayf/lint-configs
Lint configs
2 parents eb7aa61 + 06ef550 commit 7efa8e8

Some content is hidden

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

57 files changed

+130
-128
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ e230c1395d858318e90333b43aa0bdfaee177e29
66

77
# prettier 3.0
88
e6501dcc9883e65a1bc83ffd94d4030c73500a0f
9+
10+
# oxfmt sort imports
11+
6b6bdf3a84008f290c3b86716c905a4572309d4a

.oxfmtrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3-
"ignorePatterns": ["drizzle/*/snapshot.json"]
3+
"ignorePatterns": ["drizzle/*/snapshot.json"],
4+
"experimentalSortImports": {
5+
"newlinesBetween": false,
6+
"internalPattern": ["~/*"]
7+
}
48
}

app/components/Alert.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ function reducer(state: AlertState[], action: Action): AlertState[] {
3131
}
3232
}
3333

34-
const AlertContext = createContext({ dispatch: (_: Action) => {} });
34+
const DispatchAlertContext = createContext((_: Action) => {});
3535

3636
export function AlertProvider({ children }: PropsWithChildren) {
3737
const [state, dispatch] = useReducer(reducer, []);
3838
return (
3939
<>
40-
<AlertContext value={{ dispatch }}>{children}</AlertContext>
40+
<DispatchAlertContext value={dispatch}>{children}</DispatchAlertContext>
4141
<Stack>
4242
{state.map((alert) => (
4343
<Snackbar
@@ -63,7 +63,7 @@ export function useAlert(): Record<
6363
AlertColor,
6464
(message: ReactNode, persist?: boolean) => void
6565
> {
66-
const { dispatch } = use(AlertContext);
66+
const dispatch = use(DispatchAlertContext);
6767
return {
6868
success: useCallback(
6969
(message, persist = false) =>

app/components/CardItemPicture.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import Box from "@mui/material/Box";
12
import CardMedia from "@mui/material/CardMedia";
23
import Typography from "@mui/material/Typography";
3-
import Box from "@mui/material/Box";
44
import type { ClientItem } from "~/lib/schema";
55

66
export default function CardItemPicture({ item }: { item: ClientItem }) {

app/components/DisplayPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import Box from "@mui/material/Box";
12
import Card from "@mui/material/Card";
23
import CardActions from "@mui/material/CardActions";
34
import CardContent from "@mui/material/CardContent";
45
import Typography from "@mui/material/Typography";
5-
import Box from "@mui/material/Box";
66
import type { PropsWithChildren } from "react";
7-
import CardItemPicture from "./CardItemPicture";
87
import type { ClientDisplay } from "~/lib/schema";
8+
import CardItemPicture from "./CardItemPicture";
99

1010
export default function DisplayPanel({
1111
children,

app/components/EventCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CardContent from "@mui/material/CardContent";
22
import Typography from "@mui/material/Typography";
3-
import ClickableCard, { type ClickableCardProps } from "./ClickableCard";
43
import type { ClientEvent, ClientGuild } from "~/lib/schema";
4+
import ClickableCard, { type ClickableCardProps } from "./ClickableCard";
55

66
export default function EventCard({
77
guild,

app/components/GuildCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CardContent from "@mui/material/CardContent";
22
import Typography from "@mui/material/Typography";
3-
import ClickableCard, { type ClickableCardProps } from "./ClickableCard";
43
import type { ClientGuild, ClientMember } from "~/lib/schema";
4+
import ClickableCard, { type ClickableCardProps } from "./ClickableCard";
55

66
const PERMISSIONS = ["register", "write", "admin"] as const;
77

app/components/ItemCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import CardContent from "@mui/material/CardContent";
22
import Typography from "@mui/material/Typography";
3+
import type { ClientItem } from "~/lib/schema";
34
import CardItemPicture from "./CardItemPicture";
45
import ClickableCard, { type ClickableCardProps } from "./ClickableCard";
5-
import type { ClientItem } from "~/lib/schema";
66

77
export default function ItemCard({
88
item,

app/components/Navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import CloudOff from "@mui/icons-material/CloudOff";
33
import KeyboardArrowLeftIcon from "@mui/icons-material/KeyboardArrowLeft";
44
import AppBar from "@mui/material/AppBar";
55
import Avatar from "@mui/material/Avatar";
6+
import Box from "@mui/material/Box";
67
import Button from "@mui/material/Button";
78
import CircularProgress from "@mui/material/CircularProgress";
89
import IconButton from "@mui/material/IconButton";
910
import Menu from "@mui/material/Menu";
1011
import MenuItem from "@mui/material/MenuItem";
1112
import Toolbar from "@mui/material/Toolbar";
1213
import Typography from "@mui/material/Typography";
13-
import Box from "@mui/material/Box";
1414
import { useCallback, useState, useSyncExternalStore } from "react";
1515
import {
1616
Link,
@@ -19,10 +19,10 @@ import {
1919
useParams,
2020
type LinkProps,
2121
} from "react-router";
22-
import { useAlert } from "./Alert";
2322
import { useBreadcrumbs, useTitle, type Breadcrumb } from "~/lib/handle";
2423
import { useLocationType, useUrlWithRedirectTo } from "~/lib/location";
2524
import type { ClientUser } from "~/lib/schema";
25+
import { useAlert } from "./Alert";
2626

2727
export const REPOSITORY: string = "https://github.com/cm-ayf/comiacapay";
2828
export const DOCS = REPOSITORY + "/blob/main/docs";

app/entry.server.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { PassThrough } from "node:stream";
2-
3-
import type { EntryContext, RouterContextProvider } from "react-router";
2+
import createCache from "@emotion/cache";
3+
import { CacheProvider } from "@emotion/react";
4+
import createEmotionServer from "@emotion/server/create-instance";
45
import { createReadableStreamFromReadable } from "@react-router/node";
5-
import { ServerRouter } from "react-router";
66
import { isbot } from "isbot";
77
import type { RenderToPipeableStreamOptions } from "react-dom/server";
88
import { renderToPipeableStream } from "react-dom/server";
9-
import createEmotionServer from "@emotion/server/create-instance";
10-
import createCache from "@emotion/cache";
11-
import { CacheProvider } from "@emotion/react";
9+
import type { EntryContext, RouterContextProvider } from "react-router";
10+
import { ServerRouter } from "react-router";
1211

1312
export const streamTimeout = 5_000;
1413

0 commit comments

Comments
 (0)