fix oxlint warnings (#26634)

This commit is contained in:
Asuka Minato
2025-10-09 10:23:34 +09:00
committed by GitHub
parent c4d8bf0ce9
commit a8746bff30
76 changed files with 261 additions and 144 deletions

View File

@@ -28,7 +28,8 @@ const CSVUploader: FC<Props> = ({
const handleDragEnter = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
e.target !== dragRef.current && setDragging(true)
if (e.target !== dragRef.current)
setDragging(true)
}
const handleDragOver = (e: DragEvent) => {
e.preventDefault()
@@ -37,7 +38,8 @@ const CSVUploader: FC<Props> = ({
const handleDragLeave = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
e.target === dragRef.current && setDragging(false)
if (e.target === dragRef.current)
setDragging(false)
}
const handleDrop = (e: DragEvent) => {
e.preventDefault()

View File

@@ -348,7 +348,8 @@ const AppPublisher = ({
<SuggestedAction
className='flex-1'
onClick={() => {
publishedAt && handleOpenInExplore()
if (publishedAt)
handleOpenInExplore()
}}
disabled={!publishedAt || (systemFeatures.webapp_auth.enabled && !userCanAccessApp?.result)}
icon={<RiPlanetLine className='h-4 w-4' />}

View File

@@ -40,7 +40,8 @@ const VersionInfoModal: FC<VersionInfoModalProps> = ({
return
}
else {
titleError && setTitleError(false)
if (titleError)
setTitleError(false)
}
if (releaseNotes.length > RELEASE_NOTES_MAX_LENGTH) {
@@ -52,7 +53,8 @@ const VersionInfoModal: FC<VersionInfoModalProps> = ({
return
}
else {
releaseNotesError && setReleaseNotesError(false)
if (releaseNotesError)
setReleaseNotesError(false)
}
onPublish({ title, releaseNotes, id: versionInfo?.id })

View File

@@ -0,0 +1,29 @@
import type { SVGProps } from 'react'
const CitationIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
{...props}
>
<path
d="M7 6h10M7 12h6M7 18h10"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M5 6c0-1.105.895-2 2-2h10c1.105 0 2 .895 2 2v12c0 1.105-.895 2-2 2H9l-4 3v-3H7"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
fill="none"
/>
</svg>
)
export default CitationIcon

View File

@@ -79,7 +79,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
try {
return JSON.stringify(JSON.parse(tempPayload.json_schema).properties, null, 2)
}
catch (_e) {
catch {
return ''
}
}, [tempPayload.json_schema])
@@ -123,7 +123,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
}
handlePayloadChange('json_schema')(JSON.stringify(res, null, 2))
}
catch (_e) {
catch {
return null
}
}, [handlePayloadChange])

View File

@@ -480,7 +480,7 @@ const Configuration: FC = () => {
Toast.notify({ type: 'warning', message: `${t('common.modelProvider.parametersInvalidRemoved')}: ${Object.entries(removedDetails).map(([k, reason]) => `${k} (${reason})`).join(', ')}` })
setCompletionParams(filtered)
}
catch (e) {
catch {
Toast.notify({ type: 'error', message: t('common.error') })
setCompletionParams({})
}

View File

@@ -192,7 +192,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
<Button
variant="primary"
disabled={canNotRun}
onClick={() => onSend && onSend()}
onClick={() => onSend?.()}
className="w-[96px]">
<RiPlayLargeFill className="mr-0.5 h-4 w-4 shrink-0" aria-hidden="true" />
{t('appDebug.inputs.run')}
@@ -203,7 +203,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
<Button
variant="primary"
disabled={canNotRun}
onClick={() => onSend && onSend()}
onClick={() => onSend?.()}
className="w-[96px]">
<RiPlayLargeFill className="mr-0.5 h-4 w-4 shrink-0" aria-hidden="true" />
{t('appDebug.inputs.run')}

View File

@@ -38,7 +38,8 @@ const Uploader: FC<Props> = ({
const handleDragEnter = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
e.target !== dragRef.current && setDragging(true)
if (e.target !== dragRef.current)
setDragging(true)
}
const handleDragOver = (e: DragEvent) => {
e.preventDefault()
@@ -47,7 +48,8 @@ const Uploader: FC<Props> = ({
const handleDragLeave = (e: DragEvent) => {
e.preventDefault()
e.stopPropagation()
e.target === dragRef.current && setDragging(false)
if (e.target === dragRef.current)
setDragging(false)
}
const handleDrop = (e: DragEvent) => {
e.preventDefault()

View File

@@ -107,7 +107,8 @@ const Chart: React.FC<IChartProps> = ({
const { t } = useTranslation()
const statistics = chartData.data
const statisticsLen = statistics.length
const extraDataForMarkLine = new Array(statisticsLen >= 2 ? statisticsLen - 2 : statisticsLen).fill('1')
const markLineLength = statisticsLen >= 2 ? statisticsLen - 2 : statisticsLen
const extraDataForMarkLine = Array.from({ length: markLineLength }, () => '1')
extraDataForMarkLine.push('')
extraDataForMarkLine.unshift('')