gajus/eslint-plugin-jsdoc

Applying fixes with object syntax via `require-param` rule

オープン

#869 opened on 2022/04/09

 (1 件のコメント) (3 件のリアクション) (0 人の担当者)JavaScript (176 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,227 個のスター)
PR merge metrics
 (平均マージ 2d 8h) (30d で 10 merged PRs)

説明

Hi, Is there any setting/option to make the require-param rule to apply fixes by adding an object instead of properties in new lines? If not, I think moving forward with a new proposal should be acceptable 🙏🏻

Motivation

Applying fixes with object syntax in @param declarations.

Current behavior

/**
 * @param root0
 * @param root0.bar
 * @returns {void}
 */
const foo = ({ bar }) => {};

Desired behavior

/**
 * @param {{ bar: any }} param0
 * @returns {void}
 */
const foo = ({ bar }) => {};

Alternatives considered

If it is worth to mention, copy-pasting types from TypeScript files with object syntax, makes it easier to adapt it into JSDoc.

コントリビューターガイド