Skip to content

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

Description

@mnaoumov

Description

The escape-inline-tags rule incorrectly flags scoped npm package names inside {@link} declaration references as unescaped inline tags.

Example

TSDoc declaration references can target types in scoped npm packages using the package#member syntax defined in the TSDoc spec:

/**
 * Use this CodeMirror {@link @codemirror/state#StateField} to get a reference to the EditorView.
 */

The rule sees @codemirror inside the {@link} block and reports it as an unescaped inline tag, suggesting it should be escaped to \@codemirror. However, escaping breaks API Extractor / TSDoc resolution, which requires the literal @ to identify the scoped package name.

Current workaround

Adding the scope name to allowedInlineTags:

'jsdoc/escape-inline-tags': ['error', {
  allowedInlineTags: ['codemirror']
}]

This works but is a hack — every new scoped package referenced in {@link} targets requires a new entry.

Expected behavior

The rule should not flag @scope as an unescaped inline tag when it appears inside a {@link} (or {@inheritDoc}, etc.) target, since @scope/package#member is valid TSDoc declaration reference syntax.

Environment

  • eslint-plugin-jsdoc: 62.9.0
  • Node: 25.9.0
  • ESLint: 10.4.0 (flat config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions