From 6a29e7e47ef79d417e075d4a151cf21b0c80d26a Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 09:26:32 +0000 Subject: [PATCH] design-lint: heroIndexOf carries its own doc comment Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- lib/design-lint/rules/chrome-copy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/design-lint/rules/chrome-copy.ts b/lib/design-lint/rules/chrome-copy.ts index 4ed3f5170..430900b48 100644 --- a/lib/design-lint/rules/chrome-copy.ts +++ b/lib/design-lint/rules/chrome-copy.ts @@ -97,8 +97,6 @@ function checkCadenceAndDashes(ctx: LintContext, r: Reporter): void { const SECOND_CTA = /^(learn more|see how it works|watch (the )?demo|get started|book a demo)$/i; -/** The
or
that holds the h1, by tag index; -1 when none does. */ -// sloplint heroIndexOf /** The source range the hero copy lives in: the section or header holding the h1, else the h1's parent; null without an h1. A tell here is the Floor, elsewhere it is suspected. */ function heroRange(doc: Doc): [number, number] | null { const h1 = doc.tags.findIndex((t) => !t.close && t.name === 'h1'); @@ -110,6 +108,8 @@ function heroRange(doc: Doc): [number, number] | null { return inner ? [doc.tags[holder].end, inner.endPos] : null; } +/** The
or
that holds the h1, by tag index; -1 when none does. */ +// sloplint heroIndexOf export function heroIndexOf(doc: Doc, h1Idx: number): number { for (let i = h1Idx - 1; i >= 0; i--) { const t = doc.tags[i];