Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC]: add JSDoc lint rule to enforce whitespace before and after dash #13662

Copy link
Copy link

Description

@kgryte
Issue body actions

Currently, we do not catch when the dash separating a parameter name from a parameter description is bordered by more than one whitespace character. We should enforce only one whitespace character on either side of the dash. So the following is good:

/**
* ...
*
* @param {number} x - input value
* @returns {number} output value
*/

and the following should be disallowed

/**
*
* @param {number} x    -     input value
* @returns {number} output value
*/

In principle, we could have up to three different lint rules:

  1. enforce number of whitespace characters before dash
  2. enforce number of whitespace characters after dash
  3. enforce a specific character (e.g., -) to be used to separate a parameter name from a description

We could also have another lint rule for enforcing that a dash should not separate a @returns annotation from its description. This should likely be its own RFC.

Notes

Ref: #13654

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.Help WantedExtra attention is needed.Extra attention is needed.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.ToolsIssue or pull request related to project tooling.Issue or pull request related to project tooling.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.