Skip to content

checkRestProperty on check-param-names and require-param not report if destructoring have param root name declared with type #549

@thanhdx0

Description

@thanhdx0

Expected behaviour

It should warn missing param declaration on rest property even if param root name have type or not

Actual behaviour

No warning reported

ESLint Config

rules: {
    "jsdoc/check-param-names": [
          "warn",
          {
            checkRestProperty: true,
          },
    ],
    "jsdoc/require-param": [
          "warn",
          {
            checkRestProperty: true,
          }
    ],
}

ESLint sample

/**
* @param {*} param0
*/
function hello({foo, ...baz}) => {
  return foo + baz;
}

The code above will not be reported a warning by eslint.
Then if I remove param0's type ({*}), warn will show up.
So I can't make sure a function has properly its param in docs.
I'm currently working around this by leaving eslint auto-fix these with enableRootFixer and enableRestElementFixer, but not convenient to do this way with everyone in my team.

Environment

  • Node version: 13.9.0
  • ESLint version: 6.8.0
  • eslint-plugin-jsdoc version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions