fix(linter/local-refs-exist): include broken hrefs in warning hint - #5284
Draft
marcoscaceres wants to merge 1 commit into
Draft
fix(linter/local-refs-exist): include broken hrefs in warning hint#5284marcoscaceres wants to merge 1 commit into
marcoscaceres wants to merge 1 commit into
Conversation
The warning message said "Please fix the links mentioned" without listing which links were broken. Include the href values so authors can identify the broken references, especially in CLI output where element highlighting isn't available. Closes #4378
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the core/linter-rules/local-refs-exist rule’s warning hint so CLI users can see which local href values are broken, addressing #4378’s request for actionable output when many broken refs are reported.
Changes:
- Include broken
hrefvalues in the warning hint emitted bylocal-refs-exist. - Add/adjust a unit test assertion to ensure the hint includes the broken fragment identifier.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/core/linter-rules/local-refs-exist.js |
Builds a more informative warning hint by incorporating the offending href values. |
tests/unit/core/linter-rules/local-refs-exist-spec.js |
Adds coverage to assert the hint contains the broken local reference. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+36
to
+39
| const links = offendingElements | ||
| .map(el => el.getAttribute("href")) | ||
| .join(", "); | ||
| const hint = `${l10n.hint} Broken links: ${links}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4378
Include the broken href values in the warning hint so authors can
identify which links need fixing in CLI output.
Written with AI: this change was generated by Claude. Per AI_POLICY.md.