gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.09k stars 157 forks source link

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

Closed sandersn closed 8 months ago

sandersn commented 8 months ago

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

github-actions[bot] commented 8 months ago

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

The release is available on:

Your semantic-release bot :package::rocket: