Repository navigation
fix(rules): perf/dom-size dom-max-children counts body only - #550
Conversation
The widest-element check walked from <html>, so a <head> full of hreflang alternates or preload hints tripped the 60-children limit. Walk <body> instead. Total nodes and depth are unchanged. Closes #483 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Review of PR 550: skip The change is small and does what it says. Skipping
No blocking issues. |
…ody result Review follow-up for dom-size. Signed-off-by: Nik Cubrilovic <[email protected]>
|
Review of PR 550 (perf/dom-size: skip The change is small and does what it says.
I didn't run the tests. |
|
Reviewed the diff. The change is small and correct:
No blocking issues. |
|
Re the (low) parser-hoisting and frameset note: skipped deliberately, as the review says it is an edge case and acceptable. |
Summary
dom-max-childrenwalked from<html>, so a<head>with many hreflang alternates or preload hints tripped the 60-children limit. It now walks<body>only, and the reported count reflects body descendants. Total nodes and depth are unchanged (tracked separately in #548). The sri part of the original report moved to #546 and is not touched here.docs/rules/perf/dom-size.mdxand themax_childrenentry indocs/configuration/rule-options.mdxnow state what is counted.Closes #483
Verification
bun test packages/rules/tests/dom-size.test.ts: 4 pass (70 hreflang links, 70 preload links,ulwith 61lireported with value 61, no<body>does not throw and reports 0). The two head tests fail without the fix.bun run typecheckinpackages/rules: cleanmake validateindocs/: passesAgent skill
No change needed to the squirrelscan agent skill: it links to the rule pages, which are the reference and are updated here.
Checklist
Signed-off-byline (git commit -s).