gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.08k stars 155 forks source link

Missing JSDoc not reported for generic object-type parameters in TypeScript #1186

Closed ComradeVanti closed 6 months ago

ComradeVanti commented 6 months ago

Expected behavior

I have the following export in my TypeScript project:

/**
 * Command options for the login command
 */
export type LoginOptions = CmdOptions<{
  username?: string;
  password?: string;
  email?: string;
  basicAuth?: boolean;
  alwaysAuth?: boolean;
}>;

I expect to get a warning that JSDoc for properties is missing.

Actual behavior

I do not get a warning for the properties.

Notes

The properties get the expected warning if either:

ESLint Config

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:jsdoc/recommended-typescript",
    "prettier",
  ],
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
    "jsdoc/require-jsdoc": [
      "warn",
      {
        publicOnly: { ancestorsOnly: true, cjs: true },
        contexts: [
          "TSTypeAliasDeclaration",
          "TSInterfaceDeclaration",
          "TSMethodSignature",
          "TSPropertySignature",
        ],
      },
    ],
    "jsdoc/require-throws": 1,
    "jsdoc/require-returns": 0,
  },
  parser: "@typescript-eslint/parser",
  plugins: ["@typescript-eslint", "jsdoc"],
};

Environment

github-actions[bot] commented 6 months ago

:tada: This issue has been resolved in version 48.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: