Skip to content

[Request/Suggestion] Allow lines between @example tags when using linesBetween and no intra-group spaces #1594

@radioactive-exe

Description

@radioactive-exe

Currently, empty lines between multiple @example tags are considered to violate the sort-tags flag for intra-group empty lines.

The Setup

  • tag-lines set to "any", with startLines set to 1.
  • sort-tags' linesBetween set to 1.
  • prettier-jsdoc-plugin, set to insert lines between tag groups only, and not intra-group empty lines.
  • example is set in its own group under tagSequence

The Note

This cleanly enforces empty lines only between tag groups and goes well with formatters, such as the one I am using. I am using TSDoc specifications, but the logic remains the same. Often, multiple example tags are separated for readability, particularly when they contain larger amounts of code and explanation, especially compared to other tags that come in duplicates, such as @param tags. I manually add lines between the tags, but the intra-group empty lines error fires immediately. Additionally, formatters such as the one I am using insert empty lines between multiple @example tags, treating each tag as its own separate group (to fit with my style of writing and to ensure readability with longer documentation comments). This also shows the same error regarding intra-group empty lines.

The Suggestion/Request

A specific config option/subrule under sort-tags, similar to linesBetween, or under tag-lines (still set to "any") if deemed more appropriate, as an option set alongside startLines, endLines, etc., to allow empty lines in between @example and other long tags in specific or duplicate tag scenarios.

I have never contributed to or worked on linters and their plugins, but if this is a feature you would prefer I directly submit a PR for, I would appreciate it if you could perhaps point me in the right direction at least, so I know where to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions