From 2346cc60b44532732ab67cde9bdfc19aa37d2e89 Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Wed, 27 May 2026 20:57:41 +0100 Subject: [PATCH] chore: remove uncontroversial ts-expect-error suppressions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three pure typing fixes that let us drop 12 of the existing `@ts-expect-error` markers without any runtime change: - Widen `attachElement` in the React wrapper base to `(HTMLElement | SVGElement | null, any?)` so it matches React's callback ref contract (allows null on unmount, and SVG for the Spinner wrapper). Matched in the LabelGroup override. - Change `ColorPicker.set values` parameter from `Array` to `Array` to match the `IBindable` interface contract — the body already handles array-of-arrays. - Annotate the `comboItems` literal in `GradientPicker` as `Record` so the dynamic `comboItems[3] = 'Legacy'` assignment type-checks. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/Button/component.tsx | 1 - src/components/Canvas/component.tsx | 1 - src/components/ColorPicker/component.tsx | 1 - src/components/ColorPicker/index.ts | 4 +--- src/components/Container/component.tsx | 1 - src/components/Element/component.tsx | 3 +-- src/components/GradientPicker/component.tsx | 1 - src/components/GradientPicker/index.ts | 3 +-- src/components/InfoBox/component.tsx | 1 - src/components/Label/component.tsx | 1 - src/components/LabelGroup/component.tsx | 2 +- src/components/Spinner/component.tsx | 1 - 12 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/components/Button/component.tsx b/src/components/Button/component.tsx index 8f44c052..c58e5d19 100644 --- a/src/components/Button/component.tsx +++ b/src/components/Button/component.tsx @@ -11,7 +11,6 @@ class Button extends Element { static ctor = ButtonClass; render() { - // @ts-expect-error return