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,5 +1,5 @@
import * as React from 'react'
import { Text } from '@anthropic/ink'
import * as React from 'react';
import { Text } from '@anthropic/ink';
/**
* Inverse-highlight every occurrence of `query` in `text` (case-insensitive).
@@ -7,23 +7,23 @@ import { Text } from '@anthropic/ink'
* and preview panes.
*/
export function highlightMatch(text: string, query: string): React.ReactNode {
if (!query) return text
const queryLower = query.toLowerCase()
const textLower = text.toLowerCase()
const parts: React.ReactNode[] = []
let offset = 0
let idx = textLower.indexOf(queryLower, offset)
if (idx === -1) return text
if (!query) return text;
const queryLower = query.toLowerCase();
const textLower = text.toLowerCase();
const parts: React.ReactNode[] = [];
let offset = 0;
let idx = textLower.indexOf(queryLower, offset);
if (idx === -1) return text;
while (idx !== -1) {
if (idx > offset) parts.push(text.slice(offset, idx))
if (idx > offset) parts.push(text.slice(offset, idx));
parts.push(
<Text key={idx} inverse>
{text.slice(idx, idx + query.length)}
</Text>,
)
offset = idx + query.length
idx = textLower.indexOf(queryLower, offset)
);
offset = idx + query.length;
idx = textLower.indexOf(queryLower, offset);
}
if (offset < text.length) parts.push(text.slice(offset))
return <>{parts}</>
if (offset < text.length) parts.push(text.slice(offset));
return <>{parts}</>;
}