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,78 +1,64 @@
import partition from 'lodash-es/partition.js'
import React, { useCallback } from 'react'
import { logEvent } from 'src/services/analytics/index.js'
import { Box, Text } from '@anthropic/ink'
import {
getSettings_DEPRECATED,
updateSettingsForSource,
} from '../utils/settings/settings.js'
import { ConfigurableShortcutHint } from './ConfigurableShortcutHint.js'
import { SelectMulti } from './CustomSelect/SelectMulti.js'
import { Byline, Dialog, KeyboardShortcutHint } from '@anthropic/ink'
import { MCPServerDialogCopy } from './MCPServerDialogCopy.js'
import partition from 'lodash-es/partition.js';
import React, { useCallback } from 'react';
import { logEvent } from 'src/services/analytics/index.js';
import { Box, Text } from '@anthropic/ink';
import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settings/settings.js';
import { ConfigurableShortcutHint } from './ConfigurableShortcutHint.js';
import { SelectMulti } from './CustomSelect/SelectMulti.js';
import { Byline, Dialog, KeyboardShortcutHint } from '@anthropic/ink';
import { MCPServerDialogCopy } from './MCPServerDialogCopy.js';
type Props = {
serverNames: string[]
onDone(): void
}
serverNames: string[];
onDone(): void;
};
export function MCPServerMultiselectDialog({
serverNames,
onDone,
}: Props): React.ReactNode {
export function MCPServerMultiselectDialog({ serverNames, onDone }: Props): React.ReactNode {
function onSubmit(selectedServers: string[]) {
const currentSettings = getSettings_DEPRECATED() || {}
const enabledServers = currentSettings.enabledMcpjsonServers || []
const disabledServers = currentSettings.disabledMcpjsonServers || []
const currentSettings = getSettings_DEPRECATED() || {};
const enabledServers = currentSettings.enabledMcpjsonServers || [];
const disabledServers = currentSettings.disabledMcpjsonServers || [];
// Use partition to separate approved and rejected servers
const [approvedServers, rejectedServers] = partition(serverNames, server =>
selectedServers.includes(server),
)
const [approvedServers, rejectedServers] = partition(serverNames, server => selectedServers.includes(server));
logEvent('tengu_mcp_multidialog_choice', {
approved: approvedServers.length,
rejected: rejectedServers.length,
})
});
// Update settings with approved servers
if (approvedServers.length > 0) {
const newEnabledServers = [
...new Set([...enabledServers, ...approvedServers]),
]
const newEnabledServers = [...new Set([...enabledServers, ...approvedServers])];
updateSettingsForSource('localSettings', {
enabledMcpjsonServers: newEnabledServers,
})
});
}
// Update settings with rejected servers
if (rejectedServers.length > 0) {
const newDisabledServers = [
...new Set([...disabledServers, ...rejectedServers]),
]
const newDisabledServers = [...new Set([...disabledServers, ...rejectedServers])];
updateSettingsForSource('localSettings', {
disabledMcpjsonServers: newDisabledServers,
})
});
}
onDone()
onDone();
}
// Handle ESC to reject all servers
const handleEscRejectAll = useCallback(() => {
const currentSettings = getSettings_DEPRECATED() || {}
const disabledServers = currentSettings.disabledMcpjsonServers || []
const currentSettings = getSettings_DEPRECATED() || {};
const disabledServers = currentSettings.disabledMcpjsonServers || [];
const newDisabledServers = [
...new Set([...disabledServers, ...serverNames]),
]
const newDisabledServers = [...new Set([...disabledServers, ...serverNames])];
updateSettingsForSource('localSettings', {
disabledMcpjsonServers: newDisabledServers,
})
});
onDone()
}, [serverNames, onDone])
onDone();
}, [serverNames, onDone]);
return (
<>
@@ -111,5 +97,5 @@ export function MCPServerMultiselectDialog({
</Text>
</Box>
</>
)
);
}