docsConsistency: lint fixes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:08:15 +02:00
co-authored by Claude Opus 5.5
parent 6e0f59c62b
commit d39bbd01a8
+3 -3
View File
@@ -136,15 +136,15 @@ describe('docs ↔ code', () => {
test('every module page is listed in docs/README.md', () => {
const index = read('docs/README.md')
const pages = readdirSync(path.join(root, 'docs')).filter((n) => n.endsWith('.md') && !['README.md', 'CHANGELOG.md'].includes(n))
const pages = readdirSync(path.join(root, 'docs')).filter((n) => n.endsWith('.md') && !['CHANGELOG.md', 'README.md'].includes(n))
expect(pages.filter((p) => !index.includes(`(./${p})`))).toEqual([])
})
test('AGENT.md § references point at existing sections', () => {
const headings = new Set([...read('docs/agent/AGENT.md').matchAll(/^#{2,3} ([0-9]+[a-z]?(?:\.[0-9]+[a-z]?)*)\.? /gm)].map((m) => m[1]))
const headings = new Set([...read('docs/agent/AGENT.md').matchAll(/^#{2,3} (\d+[a-z]?(?:\.\d+[a-z]?)*)\.? /gm)].map((m) => m[1]))
const missing: string[] = []
for (const file of docs) {
for (const m of read(file).matchAll(/AGENT\.md ?§ ?([0-9]+[a-z]?(?:\.[0-9]+[a-z]?)*)/g)) {
for (const m of read(file).matchAll(/AGENT\.md ?§ ?(\d+[a-z]?(?:\.\d+[a-z]?)*)/g)) {
const id = m[1]
// §0b.4 may point at a numbered rule inside §0b — the parent section is enough.
if (!headings.has(id) && !headings.has(id.replace(/\.[^.]+$/, ''))) {missing.push(`${file}: §${id}`)}