stdlib-js / stdlib-js/stdlib

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

Đang mở
#13,662 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Accepted Help Wanted RFC Tools
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
tooling
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.