Skip to content

Commit f440e9f

Browse files
committed
configure biome and format again
1 parent bffb197 commit f440e9f

24 files changed

+107
-106
lines changed

apps/server/createHaiyama.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Hai, constructHai } from "shared/hai";
1+
import { constructHai, type Hai } from "shared/hai";
22

33
function shuffleArray<T>(array: T[]): T[] {
44
for (let i = array.length - 1; i > 0; i--) {

apps/server/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ app.use(
1414
}),
1515
);
1616

17-
app.get("/tiles", (req: Request, res: Response) => {
17+
app.get("/tiles", (_req: Request, res: Response) => {
1818
const haiyama = createHaiyama();
1919
res.json(haiyama);
2020
});
@@ -60,7 +60,7 @@ app.post("/scores", async (req: Request, res: Response) => {
6060
}
6161
});
6262

63-
app.get("/scores", async (req: Request, res: Response) => {
63+
app.get("/scores", async (_req: Request, res: Response) => {
6464
try {
6565
const data = await prisma.user.findMany();
6666
res.json(data);
@@ -76,7 +76,7 @@ app.get("/scores", async (req: Request, res: Response) => {
7676
}
7777
});
7878

79-
app.get("/health", (req, res) => {
79+
app.get("/health", (_req, res) => {
8080
res.send("OK");
8181
});
8282

apps/web/src/pages/Play/GameInterface.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
import type React from "react";
1010
import { useCallback, useEffect, useState } from "react";
1111
import { useNavigate } from "react-router-dom";
12-
import { sortTehai } from "shared/hai";
1312
import type { Hai } from "shared/hai";
13+
import { sortTehai } from "shared/hai";
1414
import type { PlayerInfo } from "../../App";
1515
import calculateSyantenMentsu from "../../utils/calculateSyantenMentsu";
1616
import calculateSyantenToitsu from "../../utils/calculateSyantenToitsu";
@@ -267,9 +267,7 @@ const GameInterface = (props: GameInterfaceProps) => {
267267
)}
268268
<div className="col-2 row-1">
269269
{isLoading ? (
270-
<>
271-
<HandStatusSkelton />
272-
</>
270+
<HandStatusSkelton />
273271
) : (
274272
<HandStatus
275273
mentsuSyanten={gameState.mentsuSyanten}
@@ -278,11 +276,9 @@ const GameInterface = (props: GameInterfaceProps) => {
278276
)}
279277
</div>
280278
{isLoading ? (
281-
<>
282-
<div className="col-2 row-2">
283-
<WaitingTilesSkeleton />
284-
</div>
285-
</>
279+
<div className="col-2 row-2">
280+
<WaitingTilesSkeleton />
281+
</div>
286282
) : (
287283
<div className="col-2 row-2">
288284
<WaitingTiles tehai={gameState.tehai} />

apps/web/src/pages/Play/components/DrawEnd.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,30 @@ type DrawEndProps = {
55
};
66
export default function DrawEnd(props: DrawEndProps) {
77
return (
8-
<>
8+
<div
9+
style={{
10+
justifyContent: "center",
11+
}}
12+
>
913
<div
1014
style={{
11-
justifyContent: "center",
15+
marginTop: "10px",
16+
fontSize: "80px",
17+
marginBottom: "20px",
1218
}}
1319
>
14-
<div
15-
style={{
16-
marginTop: "10px",
17-
fontSize: "80px",
18-
marginBottom: "20px",
19-
}}
20-
>
21-
流局
22-
</div>
23-
<Button
24-
variant="contained"
25-
onClick={props.drawEnd}
26-
sx={{
27-
width: "max-content",
28-
height: "20%",
29-
}}
30-
>
31-
確認
32-
</Button>
20+
流局
3321
</div>
34-
</>
22+
<Button
23+
variant="contained"
24+
onClick={props.drawEnd}
25+
sx={{
26+
width: "max-content",
27+
height: "20%",
28+
}}
29+
>
30+
確認
31+
</Button>
32+
</div>
3533
);
3634
}

apps/web/src/pages/Play/components/HandStatusSkeleton.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { Skeleton } from "@mui/material";
22

33
export default function HandStatusSkelton() {
44
return (
5-
<>
6-
<div className="h-full flex flex-col gap-4 rounded-[1rem] shadow-md">
7-
<div className="pt-4 font-medium pl-4 text-2xl text-left">向聴数</div>
8-
<div className="font-medium pl-6 text-left text-xl leading-normal w-[80%]">
9-
<Skeleton variant="text" />
10-
<Skeleton variant="text" />
11-
</div>
5+
<div className="h-full flex flex-col gap-4 rounded-[1rem] shadow-md">
6+
<div className="pt-4 font-medium pl-4 text-2xl text-left">向聴数</div>
7+
<div className="font-medium pl-6 text-left text-xl leading-normal w-[80%]">
8+
<Skeleton variant="text" />
9+
<Skeleton variant="text" />
1210
</div>
13-
</>
11+
</div>
1412
);
1513
}

apps/web/src/pages/Play/components/HandTiles.tsx

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,33 @@ function HandTiles(props: HandTilesProps) {
1515
};
1616
});
1717
return (
18-
<>
19-
<div className="flex justify-center">
20-
<ul className="flex list-none">
21-
{tehaiWithID.map((hai) => (
22-
<li key={hai.id}>
23-
<img
24-
src={`/hai/${hai.kind}_${hai.value}.png`}
25-
alt={`${hai.kind} ${hai.value}`}
26-
width="50"
27-
height="70"
28-
onClick={() => props.tedashi(hai.id)} // クリックイベントで関数を実行
29-
onKeyDown={() => props.tedashi(hai.id)} // 意味あるのか分からない
30-
style={{ cursor: "pointer" }} // クリックできることを示すためにポインターに変更
31-
/>
32-
</li>
33-
))}
34-
</ul>
18+
<div className="flex justify-center">
19+
<ul className="flex list-none">
20+
{tehaiWithID.map((hai) => (
21+
<li key={hai.id}>
22+
<img
23+
src={`/hai/${hai.kind}_${hai.value}.png`}
24+
alt={`${hai.kind} ${hai.value}`}
25+
width="50"
26+
height="70"
27+
onClick={() => props.tedashi(hai.id)} // クリックイベントで関数を実行
28+
onKeyDown={() => props.tedashi(hai.id)} // 意味あるのか分からない
29+
style={{ cursor: "pointer" }} // クリックできることを示すためにポインターに変更
30+
/>
31+
</li>
32+
))}
33+
</ul>
3534

36-
<img
37-
src={`/hai/${props.tsumo.kind}_${props.tsumo.value}.png`}
38-
alt={`${props.tsumo.kind} ${props.tsumo.value}`}
39-
width="50"
40-
height="70"
41-
onClick={() => props.tsumogiri()} // クリックイベントでtsumogiri関数を実行
42-
onKeyDown={() => props.tsumogiri()} // 意味あるのか分からない
43-
style={{ cursor: "pointer", transform: "translate(0.5rem, 1.5rem)" }} // クリックできることを示すためにポインターに変更
44-
/>
45-
</div>
46-
</>
35+
<img
36+
src={`/hai/${props.tsumo.kind}_${props.tsumo.value}.png`}
37+
alt={`${props.tsumo.kind} ${props.tsumo.value}`}
38+
width="50"
39+
height="70"
40+
onClick={() => props.tsumogiri()} // クリックイベントでtsumogiri関数を実行
41+
onKeyDown={() => props.tsumogiri()} // 意味あるのか分からない
42+
style={{ cursor: "pointer", transform: "translate(0.5rem, 1.5rem)" }} // クリックできることを示すためにポインターに変更
43+
/>
44+
</div>
4745
);
4846
}
4947

apps/web/src/pages/Result/RankingTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
2-
type MRT_ColumnDef,
32
MaterialReactTable,
3+
type MRT_ColumnDef,
44
useMaterialReactTable,
55
} from "material-react-table";
66
import { useMemo } from "react";

apps/web/src/utils/calculateMachihai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2+
constructHai,
23
type Hai,
34
type HaiKind,
45
type JihaiValue,
5-
constructHai,
66
} from "shared/hai";
77
import judgeAgari from "./judgeAgari";
88

apps/web/src/utils/calculateSyantenMentsu.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function calculateCountInfoForJihai(
8080
export function countHaiIndex(targetTehaiValue: number[]): HaiIndex {
8181
return Array(9)
8282
.fill(0)
83-
.map((v, i) => i + 1)
83+
.map((_v, i) => i + 1)
8484
.map((i) => targetTehaiValue.filter((v) => v === i).length);
8585
}
8686

@@ -100,7 +100,7 @@ export function calculateCountInfo(haiIndex: HaiIndex): MentsuCountInfo[] {
100100
mentsu: 0,
101101
candidate: 0,
102102
haveToitsu: false,
103-
}).map(([haiIndex, info]) => info);
103+
}).map(([_haiIndex, info]) => info);
104104

105105
// 効率の良いものに絞る
106106
return screenMentsuCount(infoDump);
@@ -116,7 +116,7 @@ export function screenMentsuCount(
116116
): MentsuCountInfo[] {
117117
const result: MentsuCountInfo[] = [];
118118
for (const info of infoCandidate) {
119-
let insertFlag: boolean | undefined = undefined;
119+
let insertFlag: boolean | undefined;
120120
for (const [index, infoForComparision] of result.entries()) {
121121
// 構築の方法により、同じresultの要素に対しisBetterはtrueかfalseの高々片方しかとらない
122122
const isBetter = compareInfo(info, infoForComparision);

apps/web/test/calculateMachihai.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from "bun:test";
2-
import { type Hai, constructHai } from "shared/hai";
2+
import { constructHai, type Hai } from "shared/hai";
33
import calculateMachihai from "../src/utils/calculateMachihai";
44

55
const ryanmen: Hai[] = [

0 commit comments

Comments
 (0)