sindresorhus/eslint-plugin-unicorn

Rule proposal: Doc comment asterisk prefix style

已關閉

#1,607 建立於 2021年11月11日

 (3 則留言) (2 個反應) (0 位負責人)JavaScript (468 個分叉)user submission
help wantednew rule

倉庫指標

星標
 (5,022 顆星)
PR 合併指標
 (平均合併 1天 16小時) (30 天內合併 399 個 PR)

描述

Description

I prefer not using asterisk prefix on doc comments as I find them noisy and they also make it much harder to edit comments.

I'm aware you can almost get this with the JSDoc ESLint plugin, but it's a bit heavy to add that just for this and doc comments do not necessarily need to be JSDoc, so this rule would be more general.

Fail

/**
 * Add two numbers.
 * @param {number} num1 The first number.
 * @param {number} num2 The second number.
 * @returns {number} The sum of the two numbers.
 */

Pass

/**
Add two numbers.
@param {number} num1 The first number.
@param {number} num2 The second number.
@returns {number} The sum of the two numbers.
*/

(Notice how */ moved too)

貢獻者指南