Skip to content

Multiplicated auto fixes for jsdoc/require-param #547

@Morikko

Description

@Morikko

Expected behavior

function add(a, b,c) {
  return a + b + c;
}

Save -> autofix with VScode

/**
 *
 */
function add(a, b, c) {
  return a + b + c;
}

Save -> autofix with VScode

/**
 * @param a
 * @param b
 * @param c
 */
function add(a, b, c) {
  return a + b + c;
}

Actual behavior

function add(a, b,c) {
  return a + b + c;
}

Save -> autofix with VScode

/**
 *
 */
function add(a, b, c) {
  return a + b + c;
}

Save -> autofix with VScode

/**
 * @param a
 * @param b
 * @param c
 * @param a
 * @param b
 * @param c
 * @param a
 * @param b
 * @param c
 */
function add(a, b, c) {
  return a + b + c;
}

--> It writes the params as many times as there are params in the function (here 3 times and so on)

ESLint Config

{
  "parserOptions": {
    "ecmaVersion": 2018
  },
  "env": {
    "browser": false,
    "node": true,
    "es6": true
  },
  "plugins": ["jsdoc"],
  "settings": {
    "jsdoc": {
      "mode": "typescript"
    }
  },
  "rules": {},
  "extends": ["eslint:recommended", "plugin:jsdoc/recommended"]
}

ESLint sample

function add(a, b,c) {
  return a + b + c;
}

Environment

  • Node version: 10.19.0
  • ESLint version: 6.8.0
  • eslint-plugin-jsdoc version: 25.4.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions