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/valid-types for "is" property #1221

Closed
dysphasia opened this issue Apr 4, 2024 · 2 comments · Fixed by #1222 or abdulrahman305/mockoon#4 · May be fixed by junsulee/juice-shop#4
Closed

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

dysphasia opened this issue Apr 4, 2024 · 2 comments · Fixed by #1222 or abdulrahman305/mockoon#4 · May be fixed by junsulee/juice-shop#4

Comments

@dysphasia
Copy link

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
Copy link

github-actions bot commented Apr 4, 2024

🎉 This issue has been resolved in version 48.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9
Copy link
Collaborator

brettz9 commented Apr 4, 2024

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