Skip to content

Rule to limit the number of main tags per comment block #1207

@Ploppy3

Description

@Ploppy3

Motivation

There should be only 1 @typedef per comment block.

Current behavior

But there is no rule to limit this, therefore it can lead to invalid jsdoc.

Desired behavior

Add a new rules which limits the number of "main" tags (such as @typedef) that can be used in a single comment block.
This could be autofixed by closing and opening another comment block.

Example:

Change:

/**
 * @typedef {object} Test1
 * @property {string} prop1
 * @typedef {object} Test2
 * @property {string} prop2
 */

Into:

/**
 * @typedef {object} Test1
 * @property {string} prop1
 */
/**
 * @typedef {object} Test2
 * @property {string} prop2
 */

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions