Skip to content

Commit 59074c9

Browse files
fix: lint errors + remove unnecessary document page
1 parent 6361c68 commit 59074c9

File tree

9 files changed

+22
-36
lines changed

9 files changed

+22
-36
lines changed

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"@next/next/no-duplicate-head": "off",
2727
"@next/next/no-typos": "off",
2828
"@next/next/no-before-interactive-script-outside-document": "off",
29+
"@next/next/no-styled-jsx-in-document": "off",
30+
"@next/next/no-head-import-in-document": "off",
2931
},
3032
"overrides": [
3133
{

src/api/analysis/analysis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import {
23
Player,
34
MoveMap,

src/components/Analysis/AnalysisGameList.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ export const AnalysisGameList: React.FC<AnalysisGameListProps> = ({
5151

5252
const listKeys = useMemo(() => {
5353
return analysisTournamentList
54-
? Array.from(analysisTournamentList.keys()).sort((a, b) =>
55-
b.split('---')[1].localeCompare(a.split('---')[1]),
54+
? Array.from(analysisTournamentList.keys()).sort(
55+
(a, b) =>
56+
b?.split('---')?.[1]?.localeCompare(a?.split('---')?.[1] ?? '') ??
57+
0,
5658
)
5759
: []
5860
}, [analysisTournamentList])
5961

6062
const initialOpenIndex = useMemo(() => {
6163
if (analysisTournamentList && currentId) {
62-
return listKeys.map((m) => m.split('---')[0]).indexOf(currentId[0])
64+
return listKeys.map((m) => m?.split('---')?.[0]).indexOf(currentId[0])
6365
} else {
6466
return null
6567
}

src/components/Misc/ModalContainer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const ModalContainer: React.FC<Props> = ({
1414
return (
1515
// Modal always has dismiss button so not required for a11y
1616
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
17-
(<motion.div
17+
<motion.div
1818
initial={{ opacity: 0 }}
1919
animate={{ opacity: 1 }}
2020
exit={{ opacity: 0 }}
@@ -33,6 +33,6 @@ export const ModalContainer: React.FC<Props> = ({
3333
>
3434
{children}
3535
</motion.div>
36-
</motion.div>)
37-
);
36+
</motion.div>
37+
)
3838
}

src/components/Openings/PlayOpening.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,24 @@ function Switcher({
207207
setSelected: (selected: { id: string; name: string }) => void
208208
}) {
209209
return (
210-
(<div className="flex w-full flex-col gap-0.5 px-4">
210+
<div className="flex w-full flex-col gap-0.5 px-4">
211211
<p className="text-sm text-secondary">{label}</p>
212212
<div className="flex w-full flex-row overflow-hidden rounded-sm bg-background-2/80">
213213
{options.map((option, index) => (
214214
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
215-
(<div
215+
<div
216216
key={index}
217217
role="button"
218218
tabIndex={0}
219219
onClick={() => setSelected(option)}
220220
className={`flex flex-1 cursor-pointer items-center justify-center px-2 py-1.5 ${selected.id === option.id ? 'bg-human-4/60' : 'hover:bg-human-4/10'}`}
221221
>
222222
<p className="select-none text-sm">{option.name}</p>
223-
</div>)
223+
</div>
224224
))}
225225
</div>
226-
</div>)
227-
);
226+
</div>
227+
)
228228
}
229229

230230
function ColorPicker({

src/pages/_app.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function MaiaPlatform({ Component, pageProps }: AppProps) {
3939
>
4040
<Head>
4141
<link rel="icon" type="image/png" href="/favicon.png" />
42+
<link
43+
rel="stylesheet"
44+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&display=swap"
45+
/>
4246
</Head>
4347
<div className={`${OpenSans.className} app-container`}>
4448
<Header />

src/pages/_document.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/pages/analysis/[...id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ const Analysis: React.FC<Props> = ({
453453
) : screen.id === 'export' ? (
454454
<div className="flex flex-col p-4">
455455
<ExportGame
456-
game={analyzedGame as any as PlayedGame}
456+
game={analyzedGame as unknown as PlayedGame}
457457
whitePlayer={analyzedGame.whitePlayer.name}
458458
blackPlayer={analyzedGame.blackPlayer.name}
459459
event="Analysis"

src/pages/leaderboard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react'
21
import Head from 'next/head'
3-
import { useCallback, useEffect, useState } from 'react'
2+
import React, { useCallback, useEffect, useState } from 'react'
43

54
import {
65
BrainIcon,

0 commit comments

Comments
 (0)