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,52 +1,40 @@
import React from 'react'
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
import { Box, Text } from '@anthropic/ink'
import { useKeybinding } from '../../keybindings/useKeybinding.js'
import type { SettingsJson } from '../../utils/settings/types.js'
import { Select } from '../CustomSelect/index.js'
import { PermissionDialog } from '../permissions/PermissionDialog.js'
import {
extractDangerousSettings,
formatDangerousSettingsList,
} from './utils.js'
import React from 'react';
import { useExitOnCtrlCDWithKeybindings } from '../../hooks/useExitOnCtrlCDWithKeybindings.js';
import { Box, Text } from '@anthropic/ink';
import { useKeybinding } from '../../keybindings/useKeybinding.js';
import type { SettingsJson } from '../../utils/settings/types.js';
import { Select } from '../CustomSelect/index.js';
import { PermissionDialog } from '../permissions/PermissionDialog.js';
import { extractDangerousSettings, formatDangerousSettingsList } from './utils.js';
type Props = {
settings: SettingsJson
onAccept: () => void
onReject: () => void
}
settings: SettingsJson;
onAccept: () => void;
onReject: () => void;
};
export function ManagedSettingsSecurityDialog({
settings,
onAccept,
onReject,
}: Props): React.ReactNode {
const dangerous = extractDangerousSettings(settings)
const settingsList = formatDangerousSettingsList(dangerous)
export function ManagedSettingsSecurityDialog({ settings, onAccept, onReject }: Props): React.ReactNode {
const dangerous = extractDangerousSettings(settings);
const settingsList = formatDangerousSettingsList(dangerous);
const exitState = useExitOnCtrlCDWithKeybindings()
const exitState = useExitOnCtrlCDWithKeybindings();
useKeybinding('confirm:no', onReject, { context: 'Confirmation' })
useKeybinding('confirm:no', onReject, { context: 'Confirmation' });
function onChange(value: 'accept' | 'exit'): void {
if (value === 'exit') {
onReject()
return
onReject();
return;
}
onAccept()
onAccept();
}
return (
<PermissionDialog
color="warning"
titleColor="warning"
title="Managed settings require approval"
>
<PermissionDialog color="warning" titleColor="warning" title="Managed settings require approval">
<Box flexDirection="column" gap={1} paddingTop={1}>
<Text>
Your organization has configured managed settings that could allow
execution of arbitrary code or interception of your prompts and
responses.
Your organization has configured managed settings that could allow execution of arbitrary code or interception
of your prompts and responses.
</Text>
<Box flexDirection="column">
@@ -62,8 +50,8 @@ export function ManagedSettingsSecurityDialog({
</Box>
<Text>
Only accept if you trust your organization&apos;s IT administration
and expect these settings to be configured.
Only accept if you trust your organization&apos;s IT administration and expect these settings to be
configured.
</Text>
<Select
@@ -76,13 +64,9 @@ export function ManagedSettingsSecurityDialog({
/>
<Text dimColor>
{exitState.pending ? (
<>Press {exitState.keyName} again to exit</>
) : (
<>Enter to confirm · Esc to exit</>
)}
{exitState.pending ? <>Press {exitState.keyName} again to exit</> : <>Enter to confirm · Esc to exit</>}
</Text>
</Box>
</PermissionDialog>
)
);
}