Visitar URL original
jsdoc/valid-types for "is" property · Issue #1221 · gajus/eslint-plugin-jsdoc · GitHub
Skip to content

jsdoc/valid-types for "is" property #1221

Closed
junsulee/juice-shop
#4

Description

@dysphasia

Expected behavior

Defining a property or param named is should be allowed.

Actual behavior

When defining a param or property named is, the linter reports an error for the rule jsdoc/valid-types.

ESLint Config

{
  "env": {
    "es2021": true
  },
  "extends": [
    "eslint:recommended"
  ],
  "plugins": [
    "jsdoc"
  ],
  "parserOptions": {
    "sourceType": "module",
    "ecmaVersion": "latest"
  },
  "rules": {
    "jsdoc/valid-types": 2
  }
}

ESLint sample

/**
 * @param {string} is
 * @param {string} foo
 * 
 * @returns {string}
 */
export default function (is, foo) {
    return is + foo;
}

I've also created a project that reproduces the issue on codesandbox.io:

https://codesandbox.io/p/devbox/festive-sun-g23dhw-y3vs47

Screenshot 2024-04-04 at 12 47 57 PM

Environment

  • Node version: v20.9.0
  • ESLint version: v8.57.0
  • eslint-plugin-jsdoc version: 48.2.2

Activity

  1. added a commit that references this issue on Apr 4, 2024
    001900e
  2. added a commit that references this issue on Apr 4, 2024
    ab5624b
  3. github-actions commented on Apr 4, 2024

    @github-actions

    🎉 This issue has been resolved in version 48.2.3 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  4. brettz9 commented on Apr 4, 2024

    @brettz9
    Collaborator

    The fix in #1222 doesn't handle nested use of the keyword. For that, one has to escape with quotation marks.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions