gajus/eslint-plugin-jsdoc

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

Open

#869 aperta il 9 apr 2022

Vedi su GitHub
 (1 commento) (2 reazioni) (0 assegnatari)JavaScript (172 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (1215 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor