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,15 +1,15 @@
import * as React from 'react'
import { Text } from '@anthropic/ink'
import { count } from '../utils/array.js'
import { MessageResponse } from './MessageResponse.js'
import * as React from 'react';
import { Text } from '@anthropic/ink';
import { count } from '../utils/array.js';
import { MessageResponse } from './MessageResponse.js';
type Props = {
filePath: string
structuredPatch: { lines: string[] }[]
style?: 'condensed'
verbose: boolean
previewHint?: string
}
filePath: string;
structuredPatch: { lines: string[] }[];
style?: 'condensed';
verbose: boolean;
previewHint?: string;
};
export function FileEditToolUpdatedMessage({
filePath,
@@ -18,32 +18,24 @@ export function FileEditToolUpdatedMessage({
verbose,
previewHint,
}: Props): React.ReactNode {
const numAdditions = structuredPatch.reduce(
(acc, hunk) => acc + count(hunk.lines, _ => _.startsWith('+')),
0,
)
const numRemovals = structuredPatch.reduce(
(acc, hunk) => acc + count(hunk.lines, _ => _.startsWith('-')),
0,
)
const numAdditions = structuredPatch.reduce((acc, hunk) => acc + count(hunk.lines, _ => _.startsWith('+')), 0);
const numRemovals = structuredPatch.reduce((acc, hunk) => acc + count(hunk.lines, _ => _.startsWith('-')), 0);
const text = (
<Text>
{numAdditions > 0 ? (
<>
Added <Text bold>{numAdditions}</Text>{' '}
{numAdditions > 1 ? 'lines' : 'line'}
Added <Text bold>{numAdditions}</Text> {numAdditions > 1 ? 'lines' : 'line'}
</>
) : null}
{numAdditions > 0 && numRemovals > 0 ? ', ' : null}
{numRemovals > 0 ? (
<>
{numAdditions === 0 ? 'R' : 'r'}emoved <Text bold>{numRemovals}</Text>{' '}
{numRemovals > 1 ? 'lines' : 'line'}
{numAdditions === 0 ? 'R' : 'r'}emoved <Text bold>{numRemovals}</Text> {numRemovals > 1 ? 'lines' : 'line'}
</>
) : null}
</Text>
)
);
// Plan files: invert condensed behavior
// - Regular mode: just show the hint (user can type /plan to see full content)
@@ -54,13 +46,11 @@ export function FileEditToolUpdatedMessage({
<MessageResponse>
<Text dimColor>{previewHint}</Text>
</MessageResponse>
)
);
}
} else if (style === 'condensed' && !verbose) {
return text
return text;
}
return (
<MessageResponse>{text}</MessageResponse>
)
return <MessageResponse>{text}</MessageResponse>;
}