Eslint-plugin-jsdoc: Code-climate error: Definition for rule 'jsdoc/require-jsdoc' was not found

Created on 23 Oct 2020  路  4Comments  路  Source: gajus/eslint-plugin-jsdoc

Expected behavior



The eslint-plugin-jsdoc should not raise any errors on codeclimate.

Actual behavior



When the code is pushed to my repo, codeclimate raises this error on all the files: Definition for rule 'jsdoc/require-jsdoc' was not found. However, I don't get this error on my editor.

ESLint Config

// Format JS (or JSON) code here
{ 
  "root": true,
  "extends": ["airbnb-base", "plugin:jsdoc/recommended"],
  "plugins": ["jsdoc"],
  "env": {
    "node": true,
    "es6": true,
    "mocha": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 2015,
    "sourceType": "module",
    "allowImportExportEverywhere": true
  },
  "rules": {
    "no-use-before-define": ["error", { "functions": false, "classes": false }],
    "jsdoc/require-jsdoc": ["error", {"require": {
      "FunctionDeclaration": true,
      "MethodDefinition": true,
      "ClassDeclaration": true,
      "FunctionExpression": true
    }}]
  }
}

ESLint sample


The error is triggered whenever I push to the github repo here.

Environment

  • Node version: v12.18.3
  • ESLint version v7.9.0
  • eslint-plugin-jsdoc version: ^30.7.3
bug-unconfirmed

All 4 comments

It looks like you've configured everything correctly from a purely ESLint perspective.

I have sometimes seen (though in an IDE) messages about a rule not being defined when it was apparently due to some caching relic--that the actual problem was no longer that the rule was not found, but merely that it is still showing those errors along with the real errors.

So I would try fixing the other errors like Invalid JSDoc @param "req" type "object". and The type 'object' is undefined. to see if the rule is undefined errors go away. Unfortunately, I don't see how you should be getting these errors either.

I would suggest running your npm run lint from the command line and seeing what the results are there. If you do get errors, you can report them back here. (If you get errors, we might need you to dig into node_modules/eslint-plugin-jsdoc and adding logging statements within the relevant rule code since I really don't see how you should be getting those other errors at all, but maybe a specific error message would help.)

If npm run lint gives you no errors or warnings, I think this is something you may have to take up with hound/codeclimate or check your pipeline with their tools. As far as the rule not defined error, that could be because of them not properly installing all of your devDependencies.

Thanks @brettz9 , running npm run lint did not return any errors or warnings so it probably has to do with hound and codeclimate like you said. I'll raise it as an issue on their respective repos.

I guess I can close this. Thanks for the help @brettz9

Ok, sure... Feel free to report back if you find something in case this might be something of interest to other users...

Was this page helpful?
0 / 5 - 0 ratings