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

[check-param-names] Error: "Cannot destructure property 'lines' of 'sourceCode'" #1159

Closed
simon-abbott opened this issue Sep 20, 2023 · 3 comments · Fixed by #1160
Closed

Comments

@simon-abbott
Copy link

Expected behavior

The rule should run properly.

Actual behavior

ESLint crashes with the error TypeError: Error while loading rule 'jsdoc/check-param-names': Cannot destructure property 'lines' of 'sourceCode' as it is undefined.

ESLint Config

{
  "root": true,
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true,
      "impliedStrict": true
    },
    "warnOnUnsupportedTypeScriptVersion": true,
    "requireConfigFile": false,
    "allowImportExportEverywhere": true,
    "babelOptions": {
      "presets": ["next/babel"],
      "caller": {
        "supportsTopLevelAwait": true
      }
    },
    "ecmaVersion": "latest",
    "project": "./tsconfig.json"
  },
  "plugins": ["jsdoc"],
  "rules": {
    "jsdoc/check-param-names": ["error"]
  }
}

ESLint sample

const foo = "";

Environment

  • Node version: 18.14.0
  • ESLint version 8.38.0
  • eslint-plugin-jsdoc version: 46.8.1
@simon-abbott
Copy link
Author

I tested 46.7.0 as well, and that worked just fine. I suspect it's an issue with 8dbcb6f.

@github-actions
Copy link

🎉 This issue has been resolved in version 46.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9
Copy link
Collaborator

brettz9 commented Sep 20, 2023

The method getSourceCode was deprecated and can be avoided in more recent versions of ESLint, but apparently the replacement hasn't been around for very long.

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