Address Obsidian review warnings

This commit is contained in:
murashit 2026-06-28 09:43:23 +09:00
parent 2aca116035
commit 074a379b68
3 changed files with 8 additions and 5 deletions

View file

@ -53,7 +53,6 @@ export default defineConfig([
prefer: "type-imports",
},
],
"@typescript-eslint/no-deprecated": "off",
"@typescript-eslint/require-await": "off",
},
},

View file

@ -721,8 +721,12 @@ function multiSelectOptions(schema: Extract<AppServerMcpElicitationPrimitiveSche
function stringArrayOrEmpty(value: unknown): readonly string[] {
if (!Array.isArray(value)) return [];
if (!value.every((item) => typeof item === "string")) return [];
return value;
const strings: string[] = [];
for (const item of value) {
if (typeof item !== "string") return [];
strings.push(item);
}
return strings;
}
function enumOptions(values: unknown, labels: unknown): PendingMcpElicitationOption[] {

View file

@ -1,5 +1,5 @@
import { ButtonComponent, DropdownComponent, ExtraButtonComponent, setIcon, TextComponent, ToggleComponent } from "obsidian";
import type { ButtonHTMLAttributes, JSX, Ref, ComponentChild as UiNode } from "preact";
import type { ButtonHTMLAttributes, HTMLAttributes, Ref, ComponentChild as UiNode } from "preact";
import { useLayoutEffect, useRef } from "preact/hooks";
import { disposeDomListeners, listenDomEvent } from "./dom-events.dom";
@ -68,7 +68,7 @@ export function IconButton({ icon, label, buttonRef, className, children, ...pro
);
}
export type ObsidianToolbarActionProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "className"> & {
export type ObsidianToolbarActionProps = Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
icon: string;
label: string;
actionRef?: Ref<HTMLDivElement>;