Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require-jsdoc ignores TypeScript interface members #647

Closed
eric-parsons opened this issue Oct 8, 2020 · 2 comments
Closed

require-jsdoc ignores TypeScript interface members #647

eric-parsons opened this issue Oct 8, 2020 · 2 comments

Comments

@eric-parsons
Copy link

eric-parsons commented Oct 8, 2020

I see some work has been done recently to support TypeScript interfaces for the require-jsdoc rule. Thanks! I can get it to require documentation for the interface itself, but unfortunately not for any of its members.

Expected behavior

Given this TypeScript interface:

export interface Foo {
    bar: number;
    baz: string;
    quux(): void;
}

I would expect lint warnings for missing documentation for bar, baz, and quux, given the presence of "TSPropertySignature" and "TSMethodSignature" in contexts in my config (see below).

Actual behavior

I only receive a lint warning for the missing docs on the Foo interface, but not for any of its properties or methods.

ESLint Config

"jsdoc/require-jsdoc": [
    "warn",
    {
        "publicOnly": true,
        "require": {
            "ArrowFunctionExpression": true,
            "ClassDeclaration": true,
            "ClassExpression": true,
            "FunctionDeclaration": true,
            "FunctionExpression": true,
            "MethodDefinition": true
        },
        "contexts": [
            "ArrowFunctionExpression",
            "FunctionDeclaration",
            "FunctionExpression",
            "MethodDefinition",
            "Property",
            "TSDeclareFunction",
            "TSEnumDeclaration",
            "TSInterfaceDeclaration",
            "TSMethodSignature",
            "TSPropertySignature",
            "TSTypeAliasDeclaration",
            "VariableDeclaration"
        ],
        "checkGetters": true,
        "enableFixer": false
    }
]

ESLint sample

See interface in Actual behavior above.

Environment

  • Node version: 12.18.0
  • ESLint version 7.10.0
  • eslint-plugin-jsdoc version: 30.6.3
@gajus
Copy link
Owner

gajus commented Oct 9, 2020

🎉 This issue has been resolved in version 30.6.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Oct 9, 2020
@eric-parsons
Copy link
Author

Thanks for the quick fix! Seems to be working. Now I have a bunch of documentation to write 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants