style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -69,7 +69,9 @@ export function isResultSuccessful(
if (message.type === 'assistant') {
const content = message.message!.content
const lastContent = Array.isArray(content) ? content[content.length - 1] : undefined
const lastContent = Array.isArray(content)
? content[content.length - 1]
: undefined
return (
lastContent?.type === 'text' ||
lastContent?.type === 'thinking' ||
@@ -127,7 +129,12 @@ export function* normalizeMessage(message: Message): Generator<SDKMessage> {
}
return
case 'progress': {
const progressData = message.data as { type: string; message: Message; elapsedTimeSeconds: number; taskId: string }
const progressData = message.data as {
type: string
message: Message
elapsedTimeSeconds: number
taskId: string
}
if (
progressData.type === 'agent_progress' ||
progressData.type === 'skill_progress'
@@ -158,7 +165,10 @@ export function* normalizeMessage(message: Message): Generator<SDKMessage> {
timestamp: _.timestamp,
isSynthetic: _.isMeta || _.isVisibleInTranscriptOnly,
tool_use_result: _.mcpMeta
? { content: _.toolUseResult, ...(_.mcpMeta as Record<string, unknown>) }
? {
content: _.toolUseResult,
...(_.mcpMeta as Record<string, unknown>),
}
: _.toolUseResult,
}
break
@@ -222,7 +232,10 @@ export function* normalizeMessage(message: Message): Generator<SDKMessage> {
timestamp: _.timestamp,
isSynthetic: _.isMeta || _.isVisibleInTranscriptOnly,
tool_use_result: _.mcpMeta
? { content: _.toolUseResult, ...(_.mcpMeta as Record<string, unknown>) }
? {
content: _.toolUseResult,
...(_.mcpMeta as Record<string, unknown>),
}
: _.toolUseResult,
}
}
@@ -272,7 +285,10 @@ export async function* handleOrphanedPermission(
// Create ToolUseBlock with the updated input if permission was allowed
let finalInput = toolInput
if (permissionResult.behavior === 'allow') {
const allowResult = permissionResult as { behavior: 'allow'; updatedInput?: unknown }
const allowResult = permissionResult as {
behavior: 'allow'
updatedInput?: unknown
}
if (allowResult.updatedInput !== undefined) {
finalInput = allowResult.updatedInput
} else {
@@ -291,7 +307,9 @@ export async function* handleOrphanedPermission(
if (permissionResult.behavior === 'allow') {
return {
behavior: 'allow' as const,
updatedInput: (permissionResult as { updatedInput?: Record<string, unknown> }).updatedInput,
updatedInput: (
permissionResult as { updatedInput?: Record<string, unknown> }
).updatedInput,
decisionReason: {
type: 'mode' as const,
mode: 'default' as const,
@@ -472,7 +490,9 @@ export function extractReadFilesFromMessages(
// Cache the file content with the message timestamp
if (message.timestamp) {
const timestamp = new Date(message.timestamp as string | number).getTime()
const timestamp = new Date(
message.timestamp as string | number,
).getTime()
cache.set(readFilePath, {
content: fileContent,
timestamp,
@@ -485,7 +505,9 @@ export function extractReadFilesFromMessages(
// Handle Write tool results - use content from the tool input
const writeToolData = fileWriteToolUseIds.get(content.tool_use_id)
if (writeToolData && message.timestamp) {
const timestamp = new Date(message.timestamp as string | number).getTime()
const timestamp = new Date(
message.timestamp as string | number,
).getTime()
cache.set(writeToolData.filePath, {
content: writeToolData.content,
timestamp,