接入 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:
yml2213
2026-08-16 18:04:55 +08:00
parent 5c7c3e14e3
commit 81ae04dae0
55 changed files with 3031 additions and 628 deletions
@@ -48,7 +48,7 @@ export function encryptCloudtentaclesPayload(payload: JsonObject = {}, options:
r: randomValue,
plaintext,
}
} catch (error) {
} catch {
throw createHttpError('cloudtentacles 加密失败', {
statusCode: 500,
errorCode: 'cloudtentacles_encrypt_failed',
@@ -220,11 +220,6 @@ function normalizePositiveInteger(value: unknown, fallback: number) {
return Number.isInteger(parsed) && parsed > 0 ? parsed : fallback
}
function normalizeInteger(value: unknown, fallback: number) {
const parsed = Number(value)
return Number.isInteger(parsed) ? parsed : fallback
}
function normalizeHeaderMap(extra: unknown) {
if (!extra || typeof extra !== 'object') {
return {}
@@ -339,7 +339,7 @@ async function waitForCloudtentaclesSlot(bucketKey: string, intervalMs: number)
await previousQueue
let waitMs = 0
let waitMs
try {
const now = Date.now()
const nextAvailableAt = bucketNextAvailableAt.get(bucketKey) || 0
@@ -227,7 +227,7 @@ function assertCommonPayload(
accessToken: string
paramRaw: string
},
config = assertKuaishouIndustryConfig(),
_config = assertKuaishouIndustryConfig(),
) {
if (!payload.signMethod) {
throw createHttpError('缺少 signMethod', {
@@ -377,7 +377,7 @@ async function saveTokenPayload(
}
}
function normalizeTokenResponse(json: JsonObject, currentConfig: KuaishouIndustrySourceConfig) {
function normalizeTokenResponse(json: JsonObject, _currentConfig: KuaishouIndustrySourceConfig) {
const payload = isPlainObject(json.data) ? json.data : json
const accessToken = pickFirstString(payload, ['access_token', 'accessToken', 'accessTokenValue'])
const refreshToken = pickFirstString(payload, [