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

v46.5.0's engines.node constraint is wrong #1148

Closed
emmercm opened this issue Aug 28, 2023 · 1 comment · Fixed by #1149
Closed

v46.5.0's engines.node constraint is wrong #1148

emmercm opened this issue Aug 28, 2023 · 1 comment · Fixed by #1149

Comments

@emmercm
Copy link

emmercm commented Aug 28, 2023

Expected behavior

eslint-plugin-jsdoc has the correct engines.node version constraint.

Actual behavior

eslint-plugin-jsdoc throws a TypeError on Node.js v16.3.0 (which satisfies >=16):

TypeError: Object.hasOwn is not a function
Occurred while linting <redacted>/igir/src/console/logger.ts:15
Rule: "jsdoc/check-access"
    at Object.getPreferredTagName (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js:440:14)
    at Object.utils.getPreferredTagName (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:1245:37)
    at Object.utils.forEachPreferredTag (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:1481:11)
    at _default.checkPrivate (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/rules/checkAccess.js:14:9)
    at iterate (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:1752:3)
    at callIterator (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:1888:7)
    at *:not(Program) (<redacted>/igir/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:1943:11)
    at ruleErrorHandler (<redacted>/igir/node_modules/eslint/lib/linter/linter.js:1050:28)
    at <redacted>/igir/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)

Object.hasOwn() was added in Node.js v16.9.0: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn.

ESLint Config

{
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "airbnb-base",
    "airbnb-typescript/base",
    "plugin:jsdoc/recommended-typescript-error"
  ],
  "plugins": [
    "@typescript-eslint",
    "simple-import-sort",
    "jest"
  ],

  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json",
    "sourceType": "module"
  },

  "rules": {
    "jsdoc/require-jsdoc": ["error", {
      "checkConstructors": false,
      "contexts": [
        "ClassDeclaration",
        "MethodDefinition[accessibility!=private][key.name!=/^(get|set)[A-Z][a-zA-Z]+/]"
      ]
    }],
    "jsdoc/require-param": "off",
    "jsdoc/require-returns": "off",
    "jsdoc/no-blank-blocks": "error",
  }
}

https://github.com/emmercm/igir/blob/1c5b386fd178367be8cea582c8f543f331e2c830/.eslintrc

ESLint sample

https://github.com/emmercm/igir/blob/1c5b386fd178367be8cea582c8f543f331e2c830/src/console/logger.ts

Environment

  • Node version: v16.3.0
  • ESLint version: v8.43.0
  • eslint-plugin-jsdoc version: v46.5.0

Other:

  • @typescript-eslint/eslint-plugin version: v5.60.0
  • @typescript-eslint/parser version: v5.60.0

https://github.com/emmercm/igir/blob/1c5b386fd178367be8cea582c8f543f331e2c830/package.json

@github-actions
Copy link

🎉 This issue has been resolved in version 46.5.1 🎉

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