Repository navigation
fix(rules): respect identical-link context - #1134
Conversation
8e77d9b to
e62a8d5
Compare
|
Thanks @WilliamK112, the grouping by programmatic context is the right model for #1043, the reported mega-menu passes, and the docs and tests read well. One blocker before merge, a performance one:
Please memoize per ancestor so each distinct element's context is computed once per page, for example a Everything else is non-blocking: CHANGELOG, rule page, DCO and the 5 tests are in order. |
e62a8d5 to
3bd12a2
Compare
|
Addressed in ed13564: each ancestor aria-labelledby or aria-label context is now memoized once per page, and the parent-list-item leading-link context is cached in the same entry. I added a regression with 5,000 links under one wrapper carrying eight aria-labelledby ids; it completes in about 50 ms locally, and all 6 focused tests complete in 333 ms. The focused tests, rules typecheck, formatting, lint, and diff checks pass. CI is rerunning on the pushed commit. |
Signed-off-by: Ching-Wei Kang <[email protected]>
Signed-off-by: Ching-Wei Kang <[email protected]>
ed13564 to
ef77552
Compare
|
Merged. Thank you @WilliamK112, memoizing the aria-labelledby context per ancestor with a 5,000-link regression turned a 22 second worst case into about 10 ms, and the labelled mega-menu from the issue now passes. (Nik) |
* origin/main: feat(rules): broken-link rules are reliability findings with a Reliability badge (#856) fix(rules): respect identical-link context (#1134) Signed-off-by: Nik Cubrilovic <[email protected]>
Summary
aria-labelledby,aria-label, or a parent list item's leading linkCloses #1043.
Verification
bun test packages/rules/tests(7,612 pass, 25 todo, 0 fail)bun run --filter @squirrelscan/rules typecheckbun run docs:checkoxfmt --checkandoxlinton the changed rule and testChecklist
Signed-off-byline (git commit -s).Docs: updated the identical-links-same-purpose rule page. Skill: none.