Skip to content

linter: jsdoc/check-tag-names false positive when email addresses and npm scope packages are used in tag descriptions #18380

@Mister-Hope

Description

@Mister-Hope

Enabled jsdoc plugin and all rules.

What happened?

Oxlint's jsdoc/check-tag-names rule incorrectly identifies an email address (containing an @ symbol) as a JSDoc tag when it appears within the description of another tag (like @license). This also happends when you write npm packages like @vue/shared in js doc

Reproduced Code

/**
 * @license bcrypt.js (c) 2013 Daniel Wirtz <[email protected]>
 * Released under the Apache License, Version 2.0
 */

Current Behavior

Oxlint reports an error:
× eslint-plugin-jsdoc(check-tag-names): Invalid tag name found.
help: @dcode.io> is invalid tag name.

Expected Behavior

The @dcode.io should be treated as plain text. According to the official JSDoc documentation (Block and Inline Tags):

  1. Block Tags: "Block tags always begin with an at sign (@). Each block tag must be followed by a line break, with the exception of the last block tag..."
  2. Inline Tags: "inline tags and their text must be enclosed in curly braces ({ and })."

In the example provided:

  • @dcode.io is not followed by a line break to act as a Block Tag, nor is it at the start of a new tag section.
  • @dcode.io is not enclosed in {} to be an Inline Tag.

Therefore, any @ symbol appearing in the middle of a description that is not wrapped in curly braces should be ignored by the check-tag-names rule.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions