fix(plugins): satisfy registry lint · openclaw/openclaw@fd8a878
vincentkoc
·
2026-04-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,7 @@ export async function readJsonFile<T>(filePath: string): Promise<T | null> {
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | | -export function readJsonFileSync<T>(filePath: string): T | null { |
| 39 | +export function readJsonFileSync(filePath: string): unknown { |
40 | 40 | try { |
41 | 41 | const raw = readFileSync(filePath, "utf8"); |
42 | 42 | return JSON.parse(raw) as T; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -130,7 +130,7 @@ export async function readPersistedInstalledPluginIndex(
|
130 | 130 | export function readPersistedInstalledPluginIndexSync( |
131 | 131 | options: InstalledPluginIndexStoreOptions = {}, |
132 | 132 | ): InstalledPluginIndex | null { |
133 | | -const parsed = readJsonFileSync<unknown>(resolveInstalledPluginIndexStorePath(options)); |
| 133 | +const parsed = readJsonFileSync(resolveInstalledPluginIndexStorePath(options)); |
134 | 134 | return parseInstalledPluginIndex(parsed); |
135 | 135 | } |
136 | 136 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -200,10 +200,11 @@ describe("plugin registry facade", () => {
|
200 | 200 | |
201 | 201 | it("normalizes plugin config ids through registry contribution aliases", () => { |
202 | 202 | const index = createIndex("openai"); |
| 203 | +const plugin = index.plugins[0]; |
203 | 204 | index.plugins[0] = { |
204 | | - ...index.plugins[0]!, |
| 205 | + ...plugin, |
205 | 206 | contributions: { |
206 | | - ...index.plugins[0]!.contributions, |
| 207 | + ...plugin.contributions, |
207 | 208 | providers: ["openai", "openai-codex"], |
208 | 209 | channels: ["openai-chat"], |
209 | 210 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。