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,13 +1,13 @@
import * as React from 'react'
import { pathToFileURL } from 'url'
import { Box, Link, supportsHyperlinks, Text } from '@anthropic/ink'
import { getStoredImagePath } from '../../utils/imageStore.js'
import { MessageResponse } from '../MessageResponse.js'
import * as React from 'react';
import { pathToFileURL } from 'url';
import { Box, Link, supportsHyperlinks, Text } from '@anthropic/ink';
import { getStoredImagePath } from '../../utils/imageStore.js';
import { MessageResponse } from '../MessageResponse.js';
type Props = {
imageId?: number
addMargin?: boolean
}
imageId?: number;
addMargin?: boolean;
};
/**
* Renders an image attachment in user messages.
@@ -15,12 +15,9 @@ type Props = {
* Uses MessageResponse styling to appear connected to the message above,
* unless addMargin is true (image starts a new user turn without text).
*/
export function UserImageMessage({
imageId,
addMargin,
}: Props): React.ReactNode {
const label = imageId ? `[Image #${imageId}]` : '[Image]'
const imagePath = imageId ? getStoredImagePath(imageId) : null
export function UserImageMessage({ imageId, addMargin }: Props): React.ReactNode {
const label = imageId ? `[Image #${imageId}]` : '[Image]';
const imagePath = imageId ? getStoredImagePath(imageId) : null;
const content =
imagePath && supportsHyperlinks() ? (
@@ -29,13 +26,13 @@ export function UserImageMessage({
</Link>
) : (
<Text>{label}</Text>
)
);
// When this image starts a new user turn (no text before it),
// show with margin instead of the connected line style
if (addMargin) {
return <Box marginTop={1}>{content}</Box>
return <Box marginTop={1}>{content}</Box>;
}
return <MessageResponse>{content}</MessageResponse>
return <MessageResponse>{content}</MessageResponse>;
}