Skip to content

VALIDATION-PLANES-08: Require a list of checkboxes

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

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 line
  • 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