From b83f8d8372db43bf5db26d15b88bd9eff769aeb4 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Sat, 12 Sep 2026 09:24:11 +0100 Subject: [PATCH] exclude tip from TipOptions (#2459) --- src/marks/tip.d.ts | 2 +- test/tip.test-d.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/tip.test-d.ts diff --git a/src/marks/tip.d.ts b/src/marks/tip.d.ts index 7faf45b759..6dfa5842d4 100644 --- a/src/marks/tip.d.ts +++ b/src/marks/tip.d.ts @@ -3,7 +3,7 @@ import type {Data, FrameAnchor, MarkOptions, RenderableMark} from "../mark.js"; import type {TextStyles} from "./text.js"; /** Options for the tip mark. */ -export interface TipOptions extends MarkOptions, TextStyles { +export interface TipOptions extends Omit, TextStyles { /** * The horizontal position channel specifying the tip’s anchor, typically * bound to the *x* scale. diff --git a/test/tip.test-d.ts b/test/tip.test-d.ts new file mode 100644 index 0000000000..2b88b50990 --- /dev/null +++ b/test/tip.test-d.ts @@ -0,0 +1,14 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ + +import * as Plot from "@observablehq/plot"; +import {it} from "vitest"; + +it("a nested tip option is not allowed", () => { + // @ts-expect-error + Plot.dot([], {x: 0, y: 0, tip: {tip: true}}); +}); + +it("Plot.tip does not accept a tip option", () => { + // @ts-expect-error + Plot.tip([], {x: 0, y: 0, tip: true}); +});