Skip to content

Commit faba50e

Browse files
committed
lint-fix: make eslint happy
1 parent 59a0861 commit faba50e

26 files changed

+137
-96
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ indent_style = space
66
indent_size = 2
77
insert_final_newline = true
88
trim_trailing_whitespace = true
9+
end_of_line = lf
910

1011
[*.{js,ts,jsx,tsx,css,json,md,mdx,yml,yaml}]
1112
indent_size = 2

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint"
4+
]
5+
}

src/components/FactItem.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ export const FactItem: FCC<{
1919
className,
2020
)}
2121
>
22-
{icon && <Icon icon={icon} className="mr-2 text-zinc-500 dark:text-slate-100" />}
23-
<div className="text-sm mr-2 text-zinc-500 dark:text-slate-100">{title}</div>
22+
{icon && (
23+
<Icon icon={icon} className="mr-2 text-zinc-500 dark:text-slate-100" />
24+
)}
25+
<div className="text-sm mr-2 text-zinc-500 dark:text-slate-100">
26+
{title}
27+
</div>
2428
{children}
2529
</div>
2630
)

src/components/HelperText.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ export const HelperText: FCC<{
2222
}
2323

2424
return (
25-
<div className={clsx('flex text-gray-600 dark:text-zinc-400 text-xs items-center', className)}>
25+
<div
26+
className={clsx(
27+
'flex text-gray-600 dark:text-zinc-400 text-xs items-center',
28+
className,
29+
)}
30+
>
2631
<Icon icon="info-sign" size={12} className="mr-1.5" />
2732
<div>{child()}</div>
2833
</div>

src/components/OperationCard.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ export const NeoOperationCard = ({ operation }: { operation: Operation }) => {
2020
const { data: levels } = useLevels()
2121

2222
return (
23-
<Card
24-
interactive={true}
25-
elevation={Elevation.TWO}
26-
className="relative"
27-
>
28-
<ReLink search={{ op: operation.id }} className="no-underline h-full flex flex-col gap-2">
23+
<Card interactive={true} elevation={Elevation.TWO} className="relative">
24+
<ReLink
25+
search={{ op: operation.id }}
26+
className="no-underline h-full flex flex-col gap-2"
27+
>
2928
<div className="flex">
3029
<Tooltip2
3130
content={operation.parsedContent.doc.title}

src/components/Paragraphs.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const Paragraphs: FC<{
2020
const { height } = paragraphElementRef.current.getBoundingClientRect()
2121

2222
setExceededLimitHeight(height > limitHeight)
23-
}, [paragraphElementRef.current, limitHeight])
23+
}, [limitHeight])
2424

2525
const mask = exceededLimitHeight
2626
? 'linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) calc(100% - 2rem), rgba(0,0,0,0) 100%)'
@@ -40,9 +40,7 @@ export const Paragraphs: FC<{
4040
}}
4141
>
4242
<div ref={paragraphElementRef}>
43-
{paragraphs?.map((paragraph, index) => (
44-
<p key={index}>{paragraph}</p>
45-
))}
43+
{paragraphs?.map((paragraph, index) => <p key={index}>{paragraph}</p>)}
4644
</div>
4745
</div>
4846
)

src/components/Suspensable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const Suspensable: FCC<SuspensableProps> = ({
2424
useEffect(() => {
2525
resetError.current?.()
2626
resetError.current = undefined
27+
// eslint-disable-next-line react-hooks/exhaustive-deps
2728
}, retryDeps)
2829

2930
return (

src/components/ThemeSwitchButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Button } from '@blueprintjs/core'
22

3-
import { useEffect, useState } from 'react'
3+
import { useCallback, useEffect, useState } from 'react'
44

55
const themeMedia = window.matchMedia('(prefers-color-scheme: light)')
66

77
export const ThemeSwitchButton = () => {
88
const [theme, setTheme] = useState(localStorage.getItem('theme') || '')
9-
const handleThemeSwitch = () => {
9+
const handleThemeSwitch = useCallback(() => {
1010
const isCurrentDark = theme === 'dark'
1111
setTheme(isCurrentDark ? 'light' : 'dark')
1212
localStorage.setItem('theme', isCurrentDark ? 'light' : 'dark')
13-
}
13+
}, [theme])
1414
useEffect(() => {
1515
if (!themeMedia.matches && !localStorage.getItem('theme')) {
1616
handleThemeSwitch()
@@ -23,7 +23,7 @@ export const ThemeSwitchButton = () => {
2323
document.body.classList.remove('bp4-dark')
2424
document.body.classList.remove('dark')
2525
}
26-
}, [theme])
26+
}, [theme, handleThemeSwitch])
2727
return (
2828
<Button
2929
onClick={handleThemeSwitch}

src/components/account/EditDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const InfoPanel = ({ onClose }) => {
9292

9393
useEffect(() => {
9494
reset(auth)
95-
}, [auth])
95+
}, [auth, reset])
9696

9797
const globalError = (errors as FieldErrors<{ global: void }>).global?.message
9898

src/components/announcement/AnnPanel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const AnnPanel: FC<AnnPanelProps> = ({ className }) => {
4343
setDisplaySections(freshSections)
4444
setLastNoticed(Date.now())
4545
}
46-
}, [announcement])
46+
}, [announcement, lastNoticed, setLastNoticed])
4747

4848
return (
4949
<>
@@ -60,9 +60,9 @@ export const AnnPanel: FC<AnnPanelProps> = ({ className }) => {
6060
<div className="flex">
6161
{announcement && (
6262
<ul className="grow list-disc pl-4">
63-
{announcement?.sections.slice(0, 3).map(({ title }) => (
64-
<li key={title}>{title}</li>
65-
))}
63+
{announcement?.sections
64+
.slice(0, 3)
65+
.map(({ title }) => <li key={title}>{title}</li>)}
6666
</ul>
6767
)}
6868
{!announcement && error && (

0 commit comments

Comments
 (0)