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

Context 'TSInterfaceDeclaration' not working with 'export' keyword #385

Closed
medeman opened this issue Sep 26, 2019 · 1 comment
Closed

Context 'TSInterfaceDeclaration' not working with 'export' keyword #385

medeman opened this issue Sep 26, 2019 · 1 comment
Labels

Comments

@medeman
Copy link

medeman commented Sep 26, 2019

I configured the jsdoc/require-jsdoc rule as follows:

{
  ...
  "rules": {
    "jsdoc/require-jsdoc": ["warn", {
      "require": {
        "ArrowFunctionExpression": true,
        "ClassDeclaration": true,
        "ClassExpression": true,
        "FunctionDeclaration": true,
        "FunctionExpression": true,
        "MethodDefinition": true
      },
      "contexts": [
        "ClassProperty",
        "TSInterfaceDeclaration",
        "TSPropertySignature"
      ]
    }]
  }
  ...
}

To my understanding, the TSInterfaceDeclaration context should require that interfaces have a JSDoc comment. This works just fine when used on an interface normally, i.e.:

/**
 * This example interface is great!
 */
interface Example {
  /**
   * My super test string!
   */
  test: string
}

However, when prepending the export keyword, the JSDoc comment is not detected and an error message is shown:

/**
 * This example interface is great!
 */
export interface Example {
  /**
   * My super test string!
   */
  test: string
}

This example results in eslint: jsdoc/require-jsdoc - Missing JSDoc comment. for the interface declaration.

Am I doing something wrong or is this a bug/oversight? It works fine with export class for example, just not with export interface.

@gajus
Copy link
Owner

gajus commented Sep 26, 2019

🎉 This issue has been resolved in version 15.9.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants