VALIDATION-PLANES-08: Require a list of checkboxes
What it demonstrates
Section titled “What it demonstrates”list({everyItem:‘checkbox’, minItems}) requires a list block and constrains each item, reporting offenders at their own line.
Builds on: VALIDATION-PLANES-07: Require a block kind: a table
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
import { list } from "markdown-contract";
const c = contract({ body: sections({}, [ section("Acceptance criteria", { content: list({ everyItem: "checkbox", minItems: 1 }), }),]) });// a plain (non-checkbox) bullet -> content/list/item-kind at that item's lineSurfaces exercised
Section titled “Surfaces exercised”list() leaf, everyItem: 'checkbox', minItems (src/core/leaves.ts)content/list/item-kind per offending item (src/core/content.ts validateList)content/list/min-items