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

jsdoc/require-jsdoc do not recgonize the export typr #1319

Closed
IsaacIsrael opened this issue Sep 25, 2024 · 5 comments · Fixed by #1320
Closed

jsdoc/require-jsdoc do not recgonize the export typr #1319

IsaacIsrael opened this issue Sep 25, 2024 · 5 comments · Fixed by #1320

Comments

@IsaacIsrael
Copy link

Expected behavior

type Props = {
  readyonly variant:  string
}

export type { Props as ComponentProps };

Actual behavior

// Do not recognize as error to pe enter the documentation
type Props = {
  readyonly variant:  string
}

export type { Props as ComponentProps };

ESLint Config

{
"jsdoc/require-throws": "error",
      "jsdoc/check-indentation": "warn",
      "jsdoc/no-blank-blocks": "warn",
      "jsdoc/require-asterisk-prefix": "warn",
      "jsdoc/require-description": "warn",
      "jsdoc/sort-tags": "warn",
      "jsdoc/check-syntax": "warn",
      "jsdoc/tag-lines": ["warn", "never", { startLines: 1 }],
      "jsdoc/require-param": ["warn", { checkDestructuredRoots: false }],
      "jsdoc/require-jsdoc": [
        "warn",
        {
          publicOnly: { ancestorsOnly: false},
          require: {
            FunctionDeclaration: true,
            FunctionExpression: true,
            ArrowFunctionExpression: true,
            ClassDeclaration: true,
            ClassExpression: true,
            MethodDefinition: true,
          },
          contexts: [
            "VariableDeclaration",
            "TSTypeAliasDeclaration",
            // Encourage documenting React prop types
            "TSPropertySignature",
            "TSInterfaceDeclaration",
            "TSMethodSignature",
            "TSEnumDeclaration"
          ],
          enableFixer: true,
        },
      ],
      // tsdoc checks this syntax instead
      "jsdoc/require-hyphen-before-param-description": "off",
      "jsdoc/require-returns": "off",
}

Environment

  • Node version: v20.17.0
  • ESLint version v8.57.1
  • eslint-plugin-jsdoc version: ^50.2.4
@brettz9
Copy link
Collaborator

brettz9 commented Sep 25, 2024

You have ancestorsOnly set, so it wouldn't find it anyways (that is an optimization to only find if the node is directly nested inside an export). Setting it instead to esm: true should in theory work, but it indeed does look like that is a bug. #1320 will hopefully address.

@IsaacIsrael
Copy link
Author

he @brettz9 thank for the feedback but this did not worked for me :(

@brettz9
Copy link
Collaborator

brettz9 commented Sep 25, 2024

There was a bug and I provided a fix, but the release did not successfully go through. @gajus ?

Copy link

🎉 This issue has been resolved in version 50.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus
Copy link
Owner

gajus commented Sep 25, 2024

Looks like releases broke in this commit/PR

239d69a

Reverted and it works

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