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,14 +1,11 @@
import { performBackgroundPluginInstallations } from '../../services/plugins/PluginInstallationManager.js'
import type { AppState } from '../../state/AppState.js'
import { checkHasTrustDialogAccepted } from '../config.js'
import { logForDebugging } from '../debug.js'
import {
clearMarketplacesCache,
registerSeedMarketplaces,
} from './marketplaceManager.js'
import { clearPluginCache } from './pluginLoader.js'
import { performBackgroundPluginInstallations } from '../../services/plugins/PluginInstallationManager.js';
import type { AppState } from '../../state/AppState.js';
import { checkHasTrustDialogAccepted } from '../config.js';
import { logForDebugging } from '../debug.js';
import { clearMarketplacesCache, registerSeedMarketplaces } from './marketplaceManager.js';
import { clearPluginCache } from './pluginLoader.js';
type SetAppState = (f: (prevState: AppState) => AppState) => void
type SetAppState = (f: (prevState: AppState) => AppState) => void;
/**
* Perform plugin startup checks and initiate background installations
@@ -25,21 +22,17 @@ type SetAppState = (f: (prevState: AppState) => AppState) => void
*
* @param setAppState Function to update app state with installation progress
*/
export async function performStartupChecks(
setAppState: SetAppState,
): Promise<void> {
logForDebugging('performStartupChecks called')
export async function performStartupChecks(setAppState: SetAppState): Promise<void> {
logForDebugging('performStartupChecks called');
// Check if the current directory has been trusted
if (!checkHasTrustDialogAccepted()) {
logForDebugging(
'Trust not accepted for current directory - skipping plugin installations',
)
return
logForDebugging('Trust not accepted for current directory - skipping plugin installations');
return;
}
try {
logForDebugging('Starting background plugin installations')
logForDebugging('Starting background plugin installations');
// Register seed marketplaces (CLAUDE_CODE_PLUGIN_SEED_DIR) before diffing.
// Idempotent; no-op if seed not configured. Without this, background install
@@ -48,30 +41,28 @@ export async function performStartupChecks(
// If registration changed state, clear caches so earlier plugin-load passes
// (e.g. getAllMcpConfigs during REPL init) don't keep stale "marketplace
// not found" results.
const seedChanged = await registerSeedMarketplaces()
const seedChanged = await registerSeedMarketplaces();
if (seedChanged) {
clearMarketplacesCache()
clearPluginCache('performStartupChecks: seed marketplaces changed')
clearMarketplacesCache();
clearPluginCache('performStartupChecks: seed marketplaces changed');
// Set needsRefresh so useManagePlugins notifies the user to run
// /reload-plugins. Without this signal, the initial plugin-load
// (which raced and cached "marketplace not found") would persist
// until the user manually reloads.
setAppState(prev => {
if (prev.plugins.needsRefresh) return prev
if (prev.plugins.needsRefresh) return prev;
return {
...prev,
plugins: { ...prev.plugins, needsRefresh: true },
}
})
};
});
}
// Start background installations without waiting
// This will update AppState as installations progress
await performBackgroundPluginInstallations(setAppState)
await performBackgroundPluginInstallations(setAppState);
} catch (error) {
// Even if something fails here, don't block startup
logForDebugging(
`Error initiating background plugin installations: ${error}`,
)
logForDebugging(`Error initiating background plugin installations: ${error}`);
}
}