@devries-cameron20 / t3code Mirror · read-only / commits / d598938391
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 03:15 UTC

test(lint): pin which ResizeObserver constructions no-raw-resize-observer reports (#28781)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: GPT-6.1 Sol <noreply@openai.com>

Victor committed Nov 5, 2026 at 14:21 UTC d5989383910ed1af8b8795592a9b9fb3f95e99a4
1 file changed +36
oxlint-plugin-t3code/rules/no-raw-resize-observer.test.ts new
+36
@@ -0,0 +1,36 @@
1 +import { describe } from "@effect/vitest";
2 +
3 +import { createOxlintRuleHarness } from "../test/utils.ts";
4 +
5 +const rule = createOxlintRuleHarness("t3code/no-raw-resize-observer");
6 +
7 +describe("t3code/no-raw-resize-observer", () => {
8 + rule.valid(
9 + "allows ResizeObserver types and feature detection",
10 + `
11 + let observer: ResizeObserver | null = null;
12 + export const supported = typeof ResizeObserver !== "undefined";
13 + export const entries: ResizeObserverEntry[] = [];
14 + `,
15 + );
16 +
17 + rule.valid(
18 + "allows other DOM observers",
19 + `export const observer = new MutationObserver(() => {});`,
20 + );
21 +
22 + rule.invalid(
23 + "reports a direct ResizeObserver construction",
24 + `export const observer = new ResizeObserver(() => {});`,
25 + );
26 +
27 + rule.invalid(
28 + "reports construction through a global object",
29 + `export const observer = new window.ResizeObserver(() => {});`,
30 + );
31 +
32 + rule.invalid(
33 + "reports computed construction through a global object",
34 + `export const observer = new globalThis["ResizeObserver"](() => {});`,
35 + );
36 +});