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

@@ -1,29 +1,29 @@
import React from 'react'
import { MessageResponse } from 'src/components/MessageResponse.js'
import { Text, stringWidth } from '@anthropic/ink'
import { truncateToWidthNoEllipsis } from 'src/utils/format.js'
import type { Output } from './TaskStopTool.js'
import React from 'react';
import { MessageResponse } from 'src/components/MessageResponse.js';
import { Text, stringWidth } from '@anthropic/ink';
import { truncateToWidthNoEllipsis } from 'src/utils/format.js';
import type { Output } from './TaskStopTool.js';
export function renderToolUseMessage(): React.ReactNode {
return ''
return '';
}
const MAX_COMMAND_DISPLAY_LINES = 2
const MAX_COMMAND_DISPLAY_CHARS = 160
const MAX_COMMAND_DISPLAY_LINES = 2;
const MAX_COMMAND_DISPLAY_CHARS = 160;
function truncateCommand(command: string): string {
const lines = command.split('\n')
let truncated = command
const lines = command.split('\n');
let truncated = command;
if (lines.length > MAX_COMMAND_DISPLAY_LINES) {
truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n')
truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n');
}
if (stringWidth(truncated) > MAX_COMMAND_DISPLAY_CHARS) {
truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS)
truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS);
}
return truncated.trim()
return truncated.trim();
}
export function renderToolResultMessage(
@@ -32,12 +32,12 @@ export function renderToolResultMessage(
{ verbose }: { verbose: boolean },
): React.ReactNode {
if (process.env.USER_TYPE === 'ant') {
return null
return null;
}
const rawCommand = output.command ?? ''
const command = verbose ? rawCommand : truncateCommand(rawCommand)
const suffix = command !== rawCommand ? '… · stopped' : ' · stopped'
const rawCommand = output.command ?? '';
const command = verbose ? rawCommand : truncateCommand(rawCommand);
const suffix = command !== rawCommand ? '… · stopped' : ' · stopped';
return (
<MessageResponse>
@@ -46,5 +46,5 @@ export function renderToolResultMessage(
{suffix}
</Text>
</MessageResponse>
)
);
}