Skip to content

Allow scoped package names in declaration-reference inline tags#1705

Merged
brettz9 merged 2 commits into
gajus:mainfrom
morgan-coded:fix/1695-escape-inline-tags-scoped-package
Jun 27, 2026
Merged

Allow scoped package names in declaration-reference inline tags#1705
brettz9 merged 2 commits into
gajus:mainfrom
morgan-coded:fix/1695-escape-inline-tags-scoped-package

Conversation

@morgan-coded

Copy link
Copy Markdown
Contributor

escape-inline-tags was reporting scoped npm package names inside declaration-reference inline tags, like {@link @codemirror/state#StateField}.
This allows scoped package references inside link, linkcode, linkplain, and inheritDoc inline tags while keeping bare @scope text and non-reference inline tag bodies reportable. I checked it with the focused rule tests passing 31 tests, generated docs check, changed-file ESLint, TypeScript, full Node 22 coverage at 3,132 passing with 100% coverage, build, and git diff --check.
Fixes #1695

Copilot AI review requested due to automatic review settings June 16, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates escape-inline-tags to avoid flagging scoped package references (@scope/pkg...) when they appear inside certain declaration-reference inline tags (e.g., {@link ...}, {@inheritDoc ...}), while expanding tests and docs to cover these cases.

Changes:

  • Add logic to detect when an @... match belongs to a scoped package reference inside {@link...}/{@inheritDoc...} and skip escaping in those contexts.
  • Add new rule tests covering scoped-package references in inline tags and fixer behavior.
  • Update documentation with new “problem” and “not a problem” examples.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
test/rules/assertions/escapeInlineTags.js Adds test coverage for scoped package references in inline tags and expected fixer output.
src/rules/escapeInlineTags.js Implements scoped-package detection and context-aware ignoring within certain inline tags.
docs/rules/escape-inline-tags.md Documents new examples for scoped package references in inline tags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/rules/escapeInlineTags.js
Comment thread src/rules/escapeInlineTags.js
Comment thread src/rules/escapeInlineTags.js
Comment thread src/rules/escapeInlineTags.js
@brettz9

brettz9 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Sorry, you'd be welcome to submit the PR again if you can get those Co-pilot issues fixed...

@morgan-coded morgan-coded reopened this Jun 26, 2026
@morgan-coded morgan-coded force-pushed the fix/1695-escape-inline-tags-scoped-package branch from f4ae7b5 to 29e2c55 Compare June 26, 2026 06:37
@morgan-coded

Copy link
Copy Markdown
Contributor Author

I rebased and reopened this with both review points addressed.

The multiline declaration-reference case is covered now, the escaper helper is hoisted, and the generated docs are refreshed. The focused rule suite and full test suite are passing.

@brettz9

brettz9 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Sorry, could you rebase again? Your PR is now priority.

@morgan-coded morgan-coded force-pushed the fix/1695-escape-inline-tags-scoped-package branch from 29e2c55 to b7ee2cd Compare June 27, 2026 01:21
@morgan-coded

Copy link
Copy Markdown
Contributor Author

Rebased and pushed with no other changes; local tests are passing.

@brettz9 brettz9 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@brettz9 brettz9 merged commit 70e0a11 into gajus:main Jun 27, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 63.0.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

escape-inline-tags: false positive on scoped npm packages in {@link} targets

3 participants