接入 ESLint 并清理未使用代码
- 前后端接入 ESLint 10 扁平配置(typescript-eslint 类型感知检查 + react-hooks/react-refresh),新增 lint / lint:check / lint:fix 脚本并纳入 check 链路 - 清理全部 no-unused-vars 与 no-useless-assignment 警告,修复 floating promises、正则转义等问题 - 删除确认无引用的死代码(markKuaishouCloudBindUrlRefreshFailed、未使用 helper 等)
This commit is contained in:
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'
|
||||
|
||||
export function DeadlineCountdown({
|
||||
deadlineAt,
|
||||
showExpired = false,
|
||||
showExpired: _showExpired = false,
|
||||
}: {
|
||||
deadlineAt: string
|
||||
showExpired?: boolean
|
||||
|
||||
@@ -169,15 +169,17 @@ export default function ImageUpload({
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [captureGlobalPaste])
|
||||
|
||||
function handleWrapperFocus(event: FocusEvent<HTMLDivElement>) {
|
||||
function handleWrapperFocus(_event: FocusEvent<HTMLDivElement>) {
|
||||
if (captureGlobalPaste) activateGlobalPasteTarget()
|
||||
}
|
||||
|
||||
function handleWrapperClick(event: MouseEvent<HTMLDivElement>) {
|
||||
function handleWrapperClick(_event: MouseEvent<HTMLDivElement>) {
|
||||
if (captureGlobalPaste) activateGlobalPasteTarget()
|
||||
}
|
||||
|
||||
const customRequest: UploadProps['customRequest'] = async (options) => {
|
||||
async function uploadFromRequest(
|
||||
options: Parameters<NonNullable<UploadProps['customRequest']>>[0],
|
||||
) {
|
||||
try {
|
||||
const uploaded = await uploadFile(options.file as File, scene, scope)
|
||||
// 多文件选择会并发执行 customRequest,必须以 ref 中的最新列表累加,避免后完成的上传覆盖前面的图片。
|
||||
@@ -191,6 +193,10 @@ export default function ImageUpload({
|
||||
}
|
||||
}
|
||||
|
||||
const customRequest: UploadProps['customRequest'] = (options) => {
|
||||
void uploadFromRequest(options)
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`image-upload-droppable ${isDragging ? 'is-dragging' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user