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

informative-docs doesn't work on exported declarations #1198

Closed
sandersn opened this issue Feb 6, 2024 · 1 comment · Fixed by #1199
Closed

informative-docs doesn't work on exported declarations #1198

sandersn opened this issue Feb 6, 2024 · 1 comment · Fixed by #1199

Comments

@sandersn
Copy link
Contributor

sandersn commented Feb 6, 2024

Expected behavior

Error on comment: "This description only repeats the name it describes"

Actual behavior

No error.

Deleting the export keyword provides the correct error.

ESLint Config

// Format JS (or JSON) code here
```json
{
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "warnOnUnsupportedTypeScriptVersion": false,
        "ecmaVersion": 6,
        "sourceType": "module"
    },
    "env": {
        "browser": false,
        "node": true,
        "es6": true
    },
    "plugins": [
        "jsdoc"
    ],
    "rules": {
        "jsdoc/informative-docs": "error"
    }
}

ESLint sample

Note: this is typescript but I removed the types so it should parse the same as JS.

/**
 * package name from path
 */
export function packageNameFromPath(path) {
  const base = basename(path);
  return /^v\d+(\.\d+)?$/.exec(base) || /^ts\d\.\d/.exec(base) ? basename(dirname(path)) : base;
}

Environment

  • Node version: 20.11.0
  • ESLint version 8.56.0
  • eslint-plugin-jsdoc version: 48.0.5
Copy link

github-actions bot commented Feb 6, 2024

🎉 This issue has been resolved in version 48.0.6 🎉

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants