Skip to content

Commit

Permalink
fix: lint errors + remove unnecessary document page
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjosethomas committed Feb 5, 2025
1 parent 6361c68 commit 59074c9
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"@next/next/no-duplicate-head": "off",
"@next/next/no-typos": "off",
"@next/next/no-before-interactive-script-outside-document": "off",
"@next/next/no-styled-jsx-in-document": "off",
"@next/next/no-head-import-in-document": "off",
},
"overrides": [
{
Expand Down
1 change: 1 addition & 0 deletions src/api/analysis/analysis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
Player,
MoveMap,
Expand Down
8 changes: 5 additions & 3 deletions src/components/Analysis/AnalysisGameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ export const AnalysisGameList: React.FC<AnalysisGameListProps> = ({

const listKeys = useMemo(() => {
return analysisTournamentList
? Array.from(analysisTournamentList.keys()).sort((a, b) =>
b.split('---')[1].localeCompare(a.split('---')[1]),
? Array.from(analysisTournamentList.keys()).sort(
(a, b) =>
b?.split('---')?.[1]?.localeCompare(a?.split('---')?.[1] ?? '') ??
0,
)
: []
}, [analysisTournamentList])

const initialOpenIndex = useMemo(() => {
if (analysisTournamentList && currentId) {
return listKeys.map((m) => m.split('---')[0]).indexOf(currentId[0])
return listKeys.map((m) => m?.split('---')?.[0]).indexOf(currentId[0])
} else {
return null
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Misc/ModalContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ModalContainer: React.FC<Props> = ({
return (
// Modal always has dismiss button so not required for a11y
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
(<motion.div
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
Expand All @@ -33,6 +33,6 @@ export const ModalContainer: React.FC<Props> = ({
>
{children}
</motion.div>
</motion.div>)
);
</motion.div>
)
}
10 changes: 5 additions & 5 deletions src/components/Openings/PlayOpening.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,24 +207,24 @@ function Switcher({
setSelected: (selected: { id: string; name: string }) => void
}) {
return (
(<div className="flex w-full flex-col gap-0.5 px-4">
<div className="flex w-full flex-col gap-0.5 px-4">
<p className="text-sm text-secondary">{label}</p>
<div className="flex w-full flex-row overflow-hidden rounded-sm bg-background-2/80">
{options.map((option, index) => (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
(<div
<div
key={index}
role="button"
tabIndex={0}
onClick={() => setSelected(option)}
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'}`}
>
<p className="select-none text-sm">{option.name}</p>
</div>)
</div>
))}
</div>
</div>)
);
</div>
)
}

function ColorPicker({
Expand Down
4 changes: 4 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ function MaiaPlatform({ Component, pageProps }: AppProps) {
>
<Head>
<link rel="icon" type="image/png" href="/favicon.png" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&display=swap"
/>
</Head>
<div className={`${OpenSans.className} app-container`}>
<Header />
Expand Down
22 changes: 0 additions & 22 deletions src/pages/_document.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/analysis/[...id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ const Analysis: React.FC<Props> = ({
) : screen.id === 'export' ? (
<div className="flex flex-col p-4">
<ExportGame
game={analyzedGame as any as PlayedGame}
game={analyzedGame as unknown as PlayedGame}
whitePlayer={analyzedGame.whitePlayer.name}
blackPlayer={analyzedGame.blackPlayer.name}
event="Analysis"
Expand Down
3 changes: 1 addition & 2 deletions src/pages/leaderboard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import Head from 'next/head'
import { useCallback, useEffect, useState } from 'react'
import React, { useCallback, useEffect, useState } from 'react'

import {
BrainIcon,
Expand Down

0 comments on commit 59074c9

Please sign in to comment.