stdlib-js / stdlib-js/stdlib

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

オープン
#13,662 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
Accepted Help Wanted RFC Tools
主要言語
JavaScript
スター
6k
フォーク
1.3k
平均マージ
1日 3時間
マージ済み PR(30日)
611

説明

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:

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

and the following should be disallowed

```js
/**
*
* @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: https://github.com/stdlib-js/stdlib/pull/13654

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reviewing the existing JSDoc lint rules and the behavior discussed in stdlib-js/stdlib#13654. Clarify whether this RFC covers whitespace before and after the dash only or also the other proposed rules, then identify the corresponding rule tests and make them verify the accepted and rejected examples in the issue.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。