feat: 全部类型问题解决

This commit is contained in:
claude-code-best
2026-04-11 10:24:00 +08:00
parent 7088fe3c8b
commit 6a70056910
135 changed files with 671 additions and 503 deletions

View File

@@ -69,7 +69,7 @@ function convertPluginHooksToMatchers(
continue
}
for (const matcher of matchers) {
for (const matcher of (matchers ?? [])) {
if (matcher.hooks.length > 0) {
pluginMatchers[hookEvent].push({
matcher: matcher.matcher,
@@ -195,7 +195,7 @@ export async function pruneRemovedPluginHooks(): Promise<void> {
// clearRegisteredPluginHooks; we only need to re-register survivors.
const survivors: Partial<Record<HookEvent, PluginHookMatcher[]>> = {}
for (const [event, matchers] of Object.entries(current)) {
const kept = matchers.filter(
const kept = (matchers ?? []).filter(
(m): m is PluginHookMatcher =>
'pluginRoot' in m && enabledRoots.has(m.pluginRoot),
)