Skip to content

fix(lint): raise nesting cap to 5 levels - #63

Merged
erunion merged 6 commits into
mainfrom
fix/nesting-cap-5-levels
Nov 5, 2026
Merged

erunion merged 6 commits into
mainfrom
fix/nesting-cap-5-levels

Conversation

@jeffarnim

@jeffarnim jeffarnim commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The nesting lint rule warns that pages more than 3 levels deep under a category won't render in the sidebar, even though ReadMe has supported up to 5 levels of nesting since June 2026. Customers running npx @readme/cli lint on their PRs see warnings for level 4 and 5 pages that do render in their sidebar. For the same reason, readme dev leaves those pages out of the local preview.

This raises the cap for docs and reference from 3 to 5 in both places.

Changes

  • src/validators/nesting.js: MAX_DEPTH for docs and reference goes from 3 to 5.
  • src/dev/lib/docs.js: the same 3 → 5 change to the preview's copy of the cap, so readme dev renders levels 4 and 5.
  • test/validators/nesting.test.js (new): the rule had no tests. They cover:
    • 5 levels under a category, in both docs and reference, are not flagged
    • a 6th level is flagged once per folder, with the new "only 5 will render" message
    • folders under flat directories like recipes/ are still rejected

Notes

  • The rule is a warning, so it never failed lint (exit code 1 is for errors only). This fixes noisy PR annotations, not broken CI.
  • These caps now have to stay in step with gitto by hand. If the sidebar limit changes again, both files need updating.

Testing

  • npx vitest run: 22 files, 286 tests passing
  • npx oxfmt --check on the changed files: clean

🤖 Generated with Claude Code

Jeff and others added 3 commits November 5, 2026 22:07
The sidebar renders 5 page levels under a category since readme #18931 /
gitto #2216 raised MAX_SIDEBAR_NESTING_LEVELS from 3 to 5. The nesting
validator and the dev preview still capped docs and reference at 3, so
lint warned that levels 4 and 5 wouldn't render even though they do, and
`readme dev` hid them.

Raise both caps to 5 and add tests for the validator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PMa6NvSAuJgavKvVjnL86d
The sidebar renders 5 page levels under a category since readme #18931 /
gitto #2216 raised MAX_SIDEBAR_NESTING_LEVELS from 3 to 5. The nesting
validator and the dev preview still capped docs and reference at 3, so
lint warned that levels 4 and 5 wouldn't render even though they do, and
`readme dev` hid them.

Raise both caps to 5 and add tests for the validator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PMa6NvSAuJgavKvVjnL86d
@jeffarnim
jeffarnim requested a review from erunion November 5, 2026 22:21
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Reviews (1) · Last reviewed commit: "Merge branch 'fix/nesting-cap-5-levels' ..." · Reviewed by Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 5, 2026
@erunion erunion added the bug Something isn't working label Nov 5, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review November 5, 2026 22:29

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

Comment thread src/validators/nesting.js Resolved
@erunion
erunion merged commit b9c4979 into main Nov 5, 2026
4 checks passed
@erunion
erunion deleted the fix/nesting-cap-5-levels branch November 5, 2026 22:32
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