Need help: how to run eslint with a extension

I’m developing a new extension to help split screen here. Now I’m following the review guidelines which suggest an extra eslint. My problem is that I cannot run eslint correctly with the following errors:

Oops! Something went wrong! :frowning:

ESLint: 9.20.1

TypeError: Key “rules”: Key “jsdoc/require-jsdoc”: Could not find plugin “jsdoc”.
at throwRuleNotFoundError (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/config/rule-validator.js:66:11)
at RuleValidator.validate (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/config/rule-validator.js:147:17)
at new Config (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/config/config.js:233:27)
at [finalizeConfig] (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/config/flat-config-array.js:216:16)
at FlatConfigArray.getConfigWithStatus (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/@eslint/config-array/dist/cjs/index.cjs:1178:55)
at FlatConfigArray.getConfig (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/@eslint/config-array/dist/cjs/index.cjs:1196:15)
at /home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/eslint/eslint.js:761:40
at async Promise.all (index 0)
at async ESLint.lintFiles (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/eslint/eslint.js:756:25)
at async Object.execute (/home/fuzzylogic/Programming/DragnTile@luozengcn.gmail.com/node_modules/eslint/lib/cli.js:505:23)

My eslint.config.msj is converted automatically from eslint-shell.yml as following:

export default [{
    languageOptions: {
        globals: {
            global: "readonly",
        },

        ecmaVersion: 5,
        sourceType: "module",
    },

    rules: {
        camelcase: ["error", {
            properties: "never",
            allow: ["^vfunc_", "^on_"],
        }],

        "consistent-return": "error",
        eqeqeq: ["error", "smart"],
        "prefer-arrow-callback": "error",
        "jsdoc/require-param-description": "off",

        "jsdoc/require-jsdoc": ["error", {
            exemptEmptyFunctions: true,

            publicOnly: {
                esm: true,
            },
        }],
    },
}];

Please help me to complete the eslint check, thanks.

By the way I don’t quite know about the js workflow, because I mainly working on c++.

fixed with the following config:

import jsdoc from 'eslint-plugin-jsdoc';

export default [{
    plugins: {
        jsdoc
    },

    languageOptions: {
        globals: {
            global: "readonly",
        },

        ecmaVersion: 2020,
        sourceType: "module",
    },

    rules: {
        camelcase: ["error", {
            properties: "never",
            allow: ["^vfunc_", "^on_"],
        }],

        "consistent-return": "error",
        eqeqeq: ["error", "smart"],
        "prefer-arrow-callback": "error",
        "jsdoc/require-param-description": "off",
        "jsdoc/require-jsdoc": ["error", {
            exemptEmptyFunctions: true,

            publicOnly: {
                esm: true,
            },
        }],
    },
}];

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.