Skip to content

[check-param-names] Inline parameter type throws error with TypeScript #570

@AndrewLeedham

Description

@AndrewLeedham

Expected behavior

Valid TypeScript with complex inline type to not throw an error.

Actual behavior

Using a complex inline parameter type throws an error.

ESLint Config

// .eslintrc.js
module.exports = {
  plugins: ['@typescript-eslint', 'jsdoc'],
  extends: ['plugin:@typescript-eslint/recommended'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: './tsconfig.json',
  },
  settings: {
    jsdoc: {
      mode: 'typescript',
    },
  },
  rules: {
    'jsdoc/check-param-names': 'error',
  },
};

ESLint sample

/**
 * Logs a string.
 *
 * @param input - String to output.
 */
export default function (input: {
  [foo: string]: { a: string; b: string };
}): void {
  input;
}

I have created a minimal repro here: https://github.com/AndrewLeedham/repros/tree/master/packages/eslint-jsdoc-7

Environment

  • Node version: 12.16.1
  • ESLint version 7.2.0
  • eslint-plugin-jsdoc version: 27.0.4

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions