Fix a failing `check`
Work one `check` failure from red to green — what each part of a finding is for, where it points, and what the fix looks like.
One failure, end to end: read what check printed, open the file it names, make the
edit, and see the green run. Run check covers
the report as a whole — its stages, flags and JSON shape. This page walks a single
finding, because the shape of one is the shape of all of them.
Prerequisites
Section titled “Prerequisites”- A workspace with a template — Install creates one.
- A slot declared in
section.ts— AI writes slot content adds asummary. Its edit is tosection.tsalone, which is exactly the state this page starts from.
The run
Section titled “The run”template-kit check starter✗ starter — 1 problem(s) templates/starter/sections/main/Renderer.tsx [template-kit/missing-slot-marker] Slot "summary" declared in section.ts is editable (it declares no locked: true) but never appears as data-slot-id in any rendered fixture, so the editor cannot select it. fix: Render it through its own primitive, which owns the marker: <Slot.Text slot={slot.summary} as="p" /> (the primitive for the slot's kind). docs: https://docs.homepages.io/rules/missing-slot-markerA run with a finding exits 1. Nothing else is printed: one pass reports every
problem it found, and this pass found one.
Four parts, in the order to use them
Section titled “Four parts, in the order to use them”- The file, on the line above the finding —
templates/starter/sections/main/Renderer.tsx, with a:linewhen the finding has one. Read it before the message: it is not always the file the message names, and this one is a case in point. - The id, in brackets —
template-kit/missing-slot-marker. It is stable across releases and it is what you look the failure up by. - The message. It names the thing that failed: the slot
summary. fix:, one line, the shape of the edit rather than the edit itself.
The docs: line resolves the id for you. The same page is inside the package you
already installed, at node_modules/@homepages/template-kit/guide/rules/<id>.md —
no network, and pinned to the kit version you are actually running.
One thing to translate as you read: a message describes the serialized schema —
the form the platform stores — while you author with builders. The parenthesis about
editability above is the stored spelling of a default a slot builder already gives
you; in your own declaration, a slot is editable unless it says locked: true.
Where it points, and why there
Section titled “Where it points, and why there”Renderer.tsx, not section.ts. The slot is declared correctly; what is missing is
its marker in the rendered page. check renders every one of the section’s fixtures
and reads the markers that actually reached the DOM, so a slot declared in one file
and absent from the markup in another is reported against the markup. That is also
why no source scan could have found it: an element in a branch that never runs reads
as present in the file and is absent from the page.
The edit
Section titled “The edit”Render the slot through the Slot.* primitive for its kind. The primitive owns the
marker, so it lands on the element that carries the value and cannot be forgotten:
// Renderer.tsx — beside the headline the scaffold already renders<Slot.Text slot={slot.summary} as="p" className="mt-4" />Where in the markup is yours to choose, with one constraint the next run will hold you to: the editor’s sidebar lists slots in schema declaration order, so render them in that order too.
The green run
Section titled “The green run”✓ startercheck passedExit 0, and check passed on the last line. That is the whole verdict — there is
no summary to read past it.
When you do not recognize the id
Section titled “When you do not recognize the id”Go to its page under Rules before guessing at the message. Every
id check and the lint preset can print has one, and each states the rule, why it
exists, and a worked before and after. If a run reports several, fix them together:
one pass shows you every class of problem at once, so re-running between edits only
costs you time.
Complete diff
Section titled “Complete diff”The one fence under Steps is the whole edit — a single line in
Renderer.tsx. Nothing else in the section folder moves.
Verify
Section titled “Verify”Verify with the author loop. Its third step is this command, so a green run here is the loop closing.
Rules that can fire
Section titled “Rules that can fire”missing-slot-marker— the slot still reaches no rendered fixture with its marker, because its only rendering is an element the section never renders or every rendered copy declines selection withselectable={false}.sidebar-order— the slot is rendered now, in a position the schema does not declare it in.
See also
Section titled “See also”- Run
check— the whole report: stages, the media block,--provenance, and the JSON shape. missing-slot-marker— the rule this page’s finding comes from, with its carve-outs.- Rules — every id, one page each.