fix(plugins): satisfy registry lint

This commit is contained in:
Vincent Koc
2026-04-25 06:05:14 -07:00
parent 2f622acec6
commit fd8a8789d0
3 changed files with 5 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ export async function readJsonFile<T>(filePath: string): Promise<T | null> {
}
}
export function readJsonFileSync<T>(filePath: string): T | null {
export function readJsonFileSync(filePath: string): unknown {
try {
const raw = readFileSync(filePath, "utf8");
return JSON.parse(raw) as T;

View File

@@ -130,7 +130,7 @@ export async function readPersistedInstalledPluginIndex(
export function readPersistedInstalledPluginIndexSync(
options: InstalledPluginIndexStoreOptions = {},
): InstalledPluginIndex | null {
const parsed = readJsonFileSync<unknown>(resolveInstalledPluginIndexStorePath(options));
const parsed = readJsonFileSync(resolveInstalledPluginIndexStorePath(options));
return parseInstalledPluginIndex(parsed);
}

View File

@@ -200,10 +200,11 @@ describe("plugin registry facade", () => {
it("normalizes plugin config ids through registry contribution aliases", () => {
const index = createIndex("openai");
const plugin = index.plugins[0];
index.plugins[0] = {
...index.plugins[0]!,
...plugin,
contributions: {
...index.plugins[0]!.contributions,
...plugin.contributions,
providers: ["openai", "openai-codex"],
channels: ["openai-chat"],
},