refactor: use format to construct error in _tools/remark/plugins/remark-namespace-toc - #15127
Draft
Planeshifter wants to merge 1 commit into
Draft
refactor: use format to construct error in _tools/remark/plugins/remark-namespace-toc#15127Planeshifter wants to merge 1 commit into
format to construct error in _tools/remark/plugins/remark-namespace-toc#15127Planeshifter wants to merge 1 commit into
Conversation
…emark-namespace-toc` Normalize error-message construction in the TOC transformer to use `@stdlib/string/format` in place of string concatenation, matching the sibling convention in `_tools/remark/plugins`. `format` is the error-construction idiom in 11 of the 12 error-constructing packages in the namespace (~92%); `remark-namespace-toc` was the sole outlier. The rendered message text is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DUP1buS4hqMNkdDbim1cNn
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.
Description
This pull request:
_tools/remark/plugins/remark-namespace-tocto use@stdlib/string/formatin place of string concatenationremark-namespace-tocThe TOC transformer assembled its one thrown-error message via string concatenation, the lone deviation from the namespace convention.
formatis the error-construction idiom in 11 of the 12 error-constructing packages in_tools/remark/plugins(~92%). The message is now built withformat, leaving the rendered text byte-for-byte identical. No observable behavior, signature, or test expectation changes.Related Issues
No.
Questions
No.
Other
Surfaced by an automated cross-package drift scan of the
_tools/remark/pluginsnamespace.package.jsonshape, README sections, and the file tree are already uniform across the namespace, so no structural change is warranted; in particular, nopackage.jsondependency edit is needed, since the namespace declares runtime dependencies as{}and requires@stdlib/string/formatin code, per sibling convention.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced by Claude Code (Opus 4.8) running an automated cross-package drift-detection routine. It extracted structural and semantic features across the namespace, identified the majority error-construction pattern, validated the single outlier through multiple independent review passes, and applied the mechanical, behavior-preserving fix.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01DUP1buS4hqMNkdDbim1cNn
Generated by Claude Code