Skip to content

fix(lint): don't flag empty index.md pages whose children live in nested directories - #59

Merged
erunion merged 5 commits into
mainfrom
fix/lint-empty-index-nested-children
Nov 3, 2026
Merged

erunion merged 5 commits into
mainfrom
fix/lint-empty-index-nested-children

Conversation

@olehshh

@olehshh olehshh commented Oct 23, 2026

Copy link
Copy Markdown
Member
🚥 Resolves CX-4166

🧰 Changes

lint was reporting Empty page: non-hidden page has no content for an empty index.md when its only children were nested page directories, e.g.:

directory/
--index.md ← flagged
--nested/
----index.md

The content validator only treated an empty index.md as a parent page if it had a sibling .md file, so adding a regular page.md next to it made the warning go away. It now also counts subdirectories that contain at least one .md file as child pages.

🧬 QA & Testing

  • Added test/validators/content.test.js covering:
    • empty index.md with a sibling page → not flagged
    • empty index.md with only a nested page directory → not flagged (fails without this fix)
    • empty index.md with no children → still flagged
  • Ran lint --no-check against the repro structure above: the warning appears on main and is gone on this branch.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new bugs were found.

Reviews (4) · Last reviewed commit: "fix(lint): treat .MD and .mdx files as c..." · Reviewed by Greptile

Comment thread src/validators/content.js Resolved
@olehshh

olehshh commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

@greptileai

@olehshh
olehshh marked this pull request as ready for review October 23, 2026 15:18
@olehshh

olehshh commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

@greptileai

greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 27, 2026
@olehshh
olehshh requested a review from erunion October 27, 2026 13:20
Comment thread src/validators/content.js Resolved
@greptile-apps
greptile-apps Bot dismissed their stale review October 30, 2026 09:24

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@olehshh

olehshh commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

@greptileai

@erunion erunion added the bug Something isn't working label Nov 3, 2026
@erunion
erunion merged commit 6fa25f4 into main Nov 3, 2026
4 checks passed
@erunion
erunion deleted the fix/lint-empty-index-nested-children branch November 3, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants