import { LintResult } from '../linter.js'; import { Root } from 'mdast'; import { visit } from 'unist-util-visit'; export function checkCallouts(tree: Root): LintResult[] { const results: LintResult[] = []; visit(tree, 'containerDirective' as any, (node: any) => { if (node.name === 'step') { // Rule 8: `:::step` 内は番号付きリストで構成 // Check children of the directive content. // Usually directive children are paragraphs or lists. // We expect at least one 'list' with ordered: true. const hasOrderedList = node.children.some((child: any) => child.type === 'list' && child.ordered === true); if (!hasOrderedList) { results.push({ ruleId: '8', message: '`:::step` block must contain an ordered list' }); } } }); return results; }