more react rules & support type-aware linting for later

This commit is contained in:
dwelle
2026-01-25 18:20:13 +01:00
parent 29ba7fe96d
commit e1f6429e49
11 changed files with 93 additions and 8 deletions
+3
View File
@@ -467,6 +467,7 @@ export class Delta<T> {
} else {
assertNever(
join,
// oxlint-disable-next-line typescript/restrict-template-expressions
`Unknown distinctKeysIterator's join param "${join}"`,
true,
);
@@ -860,6 +861,7 @@ export class AppStateDelta implements DeltaContainer<AppState> {
default:
assertNever(
key,
// oxlint-disable-next-line typescript/restrict-template-expressions
`Unknown ObservedElementsAppState's key "${key}"`,
true,
);
@@ -1332,6 +1334,7 @@ export class ElementsDelta implements DeltaContainer<SceneElementsMap> {
for (const key of Object.keys(partial) as Array<keyof typeof partial>) {
// do not update following props:
// - `boundElements`, as it is a reference value which is postprocessed to contain only deleted/inserted keys
// oxlint-disable-next-line typescript/switch-exhaustiveness-check
switch (key) {
case "boundElements":
latestPartial[key] = partial[key];
@@ -1,3 +1,4 @@
// oxlint-disable typescript/no-misused-spread
import {
pointCenter,
pointFrom,
+1
View File
@@ -1,3 +1,4 @@
// oxlint-disable typescript/no-misused-spread
import clsx from "clsx";
import throttle from "lodash.throttle";
import React, { useContext } from "react";
@@ -262,7 +262,9 @@ const renderElementToSvg = (
div.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
div.style.width = "100%";
div.style.height = "100%";
// oxlint-disable-next-line react/iframe-missing-sandbox
const iframe = div.ownerDocument.createElement("iframe");
iframe.setAttribute("sandbox", "");
iframe.src = embedLink?.link ?? "";
iframe.style.width = "100%";
iframe.style.height = "100%";