fix(cli): resolve strict TS build errors from #470/#502/#508

- Cast loadConfig() through unknown for editor_uri template lookup
- Type cli.opts.json access and handle string[] collection in bench
This commit is contained in:
Tobias Lütke 2026-04-05 18:26:21 -04:00
parent 4383accf0f
commit 7b3cb550fe

View File

@ -1878,7 +1878,7 @@ function getEditorUriTemplate(): string {
if (envTemplate) return envTemplate;
try {
const config = loadConfig() as {
const config = loadConfig() as unknown as {
editor_uri?: string;
editor_uri_template?: string;
editorUri?: string;
@ -3150,9 +3150,10 @@ if (isMain) {
process.exit(1);
}
const { runBenchmark } = await import("../bench/bench.js");
const benchCollection = cli.opts.collection;
await runBenchmark(fixturePath, {
json: !!cli.opts.json,
collection: cli.opts.collection,
json: !!(cli.opts as { json?: boolean }).json,
collection: Array.isArray(benchCollection) ? benchCollection[0] : benchCollection,
});
break;
}