Skip to content

Commit 737b5e5

Browse files
committed
fix: fix lint errors
1 parent 29b3dec commit 737b5e5

File tree

16 files changed

+52
-22
lines changed

16 files changed

+52
-22
lines changed

web/biome.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
"extends": [
44
"./node_modules/@mh4gf/configs/biome/index.jsonc",
55
"./node_modules/@mh4gf/configs/biome/react.jsonc"
6-
]
6+
],
7+
"linter": {
8+
"rules": {
9+
"correctness": {
10+
"useImportExtensions": "off"
11+
},
12+
"performance": {
13+
"noBarrelFile": "off",
14+
"noReExportAll": "off"
15+
}
16+
}
17+
}
718
}

web/playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig, devices } from '@playwright/test'
22

3+
// biome-ignore lint/style/noDefaultExport: playwright requires default export
34
export default defineConfig({
45
testDir: './src/__vrt__',
56
testMatch: 'vrt.test.ts',

web/src/__vrt__/vrt.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { test, type Page, type TestInfo, expect } from '@playwright/test'
1+
import { type Page, type TestInfo, expect, test } from '@playwright/test'
22

33
interface TargetPage {
44
name: string
55
path: string
66
}
77

8-
const screenshot = async (page: Page, testInfo: TestInfo, targetPage: TargetPage) => {
8+
const screenshot = async (page: Page, _testInfo: TestInfo, targetPage: TargetPage) => {
99
await page.goto(targetPage.path)
1010
await expect(page).toHaveScreenshot({ fullPage: true })
1111
}

web/src/app/_auth/getServerSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { getServerSession as nextAuthGetServerSession } from 'next-auth'
22

33
import { authOptions } from './options'
44

5-
export async function getServerSession() {
5+
export function getServerSession() {
66
return nextAuthGetServerSession(authOptions)
77
}

web/src/app/_components/Button.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const Button: FC<Props> = ({ isLoading, isDisabled, children, ...rest })
4343
<BaseButton disabled {...rest}>
4444
<svg
4545
aria-hidden="true"
46-
role="status"
4746
className="mr-3 inline h-4 w-4 animate-spin text-white"
4847
viewBox="0 0 100 101"
4948
fill="none"
@@ -52,11 +51,11 @@ export const Button: FC<Props> = ({ isLoading, isDisabled, children, ...rest })
5251
<path
5352
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
5453
fill="#E5E7EB"
55-
></path>
54+
/>
5655
<path
5756
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
5857
fill="currentColor"
59-
></path>
58+
/>
6059
</svg>
6160
Loading...
6261
</BaseButton>
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
import type { ComponentProps, FC } from 'react'
1+
import type { ComponentProps, FC, ReactNode } from 'react'
22

3-
type Props = ComponentProps<'label'>
3+
type Props = Omit<ComponentProps<'label'>, 'children'> & {
4+
children: ReactNode
5+
htmlFor?: string
6+
}
47

5-
export const Label: FC<Props> = (props) => {
6-
return <label {...props} className={`block text-sm font-medium leading-6 text-slate-900`} />
8+
export const Label: FC<Props> = ({ children, htmlFor, ...props }) => {
9+
return (
10+
<label
11+
htmlFor={htmlFor}
12+
{...props}
13+
className={'block text-sm font-medium leading-6 text-slate-900'}
14+
>
15+
{children}
16+
</label>
17+
)
718
}

web/src/app/_features/CopyToClipboardButton/CopyToClipboardButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const CopyToClipboardButton: FC<Props> = ({ text }) => {
2222
navigator.clipboard
2323
.writeText(text)
2424
.then(() => setShowTooltip(true))
25-
.catch((e) => console.error(e))
25+
.catch((_e) => {
26+
/* エラー処理 */
27+
})
2628
setIsLoading(false)
2729
}, [text, setShowTooltip])
2830

web/src/app/_features/CopyToClipboardButton/useSuccessTooltip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export const useSuccessTooltip = () => {
44
const [show, setShow] = useState(false)
55

66
useEffect(() => {
7-
if (!show) return
7+
if (!show) {
8+
return
9+
}
810

911
const timer = setTimeout(() => {
1012
setShow(false)

web/src/app/_features/GitHubNippouMain/GistIdInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useLocalStorageState } from 'ahooks'
22
import Link from 'next/link'
3+
import type { ChangeEvent } from 'react'
34

45
import { Input, Label } from '../../_components'
56

@@ -26,7 +27,7 @@ export const GistIdInput = () => {
2627
name="settingsGistId"
2728
id="settingsGistId"
2829
defaultValue={gistId}
29-
onChange={(e) => setGistId(e.target.value)}
30+
onChange={(e: ChangeEvent<HTMLInputElement>) => setGistId(e.target.value)}
3031
/>
3132
</div>
3233
</div>

web/src/app/_features/GitHubNippouMain/GitHubNippouMain.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// useCallback, useStateはClient Componentでしか使えない
22
'use client'
33

4-
import { useState, useCallback } from 'react'
5-
import type { FormEvent, FC } from 'react'
4+
import { useCallback, useState } from 'react'
5+
import type { FC, FormEvent } from 'react'
66

77
import { CopyToClipboardButton } from '../CopyToClipboardButton'
88

@@ -30,8 +30,7 @@ export const GitHubNippouMain: FC = () => {
3030
.then(async (res) => {
3131
setState((await res.json()) as NippouResult)
3232
})
33-
.catch((error: unknown) => {
34-
console.error(error)
33+
.catch((_error: unknown) => {
3534
setState({ success: false, error: 'An unexpected error has occurred' })
3635
})
3736

0 commit comments

Comments
 (0)