Skip to content

Error using flat config #989

@fractionalJoe

Description

@fractionalJoe

Expected behavior

Enforce the check-access rule. Same issue occurs for any rule I've tried, not just check-access. This is just an example.

Actual behavior

Throws this exception:

> eslint .


Oops! Something went wrong! :(

ESLint: 8.35.0

TypeError: Error while loading rule 'jsdoc/check-access': Cannot read properties of undefined (reading 'includes')
Occurred while linting /home/joe/repos/ndevr.core/packages/eslint.config.js
    at getSettings (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint-plugin-jsdoc@40.0.0_eslint@8.35.0/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:678:174)
    at Object.create (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint-plugin-jsdoc@40.0.0_eslint@8.35.0/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:906:18)
    at createRuleListeners (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:926:21)
    at /home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:1108:110
    at Array.forEach (<anonymous>)
    at runRules (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:1045:34)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:1696:31)
    at Linter._verifyWithFlatConfigArray (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:1825:21)
    at Linter.verify (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:1475:65)
    at Linter.verifyAndFix (/home/joe/repos/ndevr.core/node_modules/.pnpm/eslint@8.35.0/node_modules/eslint/lib/linter/linter.js:2031:29)
/home/joe/repos/ndevr.core/packages:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  ndevr.core.packages@ lint: `eslint .`
Exit status 2
 ELIFECYCLE  Command failed with exit code 1.

ESLint Config

// eslint.config.js New Flat Config
import ts from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import jsdoc from "eslint-plugin-jsdoc";

export default [
  {
    files: [
      "**/*.ts",
      "**/*.js",
    ],
    ignores: [
      "**/build/**",
    ],
    languageOptions: {
      parser: tsParser,
      parserOptions: {
        ecmaVersion: 2020,
        sourceType: "module",
      },
    },
    plugins: {
      "@typescript-eslint": ts,
      jsdoc
    },
    rules: {
      "jsdoc/check-access": 1,
    },
  },
];

ESLint sample

/**
 * Strip all non-word characters out of string
 * @param {string} value The string value to be stripped
 * @returns {string} Stripped value
 */
const stripString = function(value: string): string {
  return value.replace(/(^\w)/, "");
};

Environment

  • Node version: 18.14.2
  • ESLint version 8.35.0
  • eslint-plugin-jsdoc version: 40.0.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions