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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsdoc/require-jsdoc] : 'checkConstructors' + 'require' = fail #611

Closed
RichardFevrier opened this issue Jul 20, 2020 · 1 comment
Closed

Comments

@RichardFevrier
Copy link

Hello everyone 馃憢

Expected behavior

CLI working properly

Actual behavior

When using the configuration below, more importantly 'checkConstructors' and 'require' (not just empty but populated) an error occurs during the execution of the CLI on basically every js file (see my example).
Error occurring:

TypeError: Cannot read property 'tags' of null
at hasTag --- jsdocUtils.js:308:37

Apparently the jsdoc passed to this function seems to be null in this case.

ESLint Config

module.exports = {
  root: true,
  globals: {
    'console': false
  },
  parser: "babel-eslint",
  extends: ['eslint:recommended', 'plugin:jsdoc/recommended'],
  rules: {
    'jsdoc/check-types': ['error', {
      noDefaults: true
    }],
    'jsdoc/no-undefined-types': 'off',
    'jsdoc/require-jsdoc': ['error', {
      checkConstructors: false, // <- problem between this
      require: {
        ArrowFunctionExpression: true, // <- and these
        ClassDeclaration: false,
        ClassExpression: true,
        FunctionDeclaration: true,
        FunctionExpression: true,
        MethodDefinition: true
      }
    }],
    'jsdoc/require-param-description': 'off',
    'jsdoc/require-property-description': 'off',
    'jsdoc/require-returns': ['error', {
      checkConstructors: false, 
      checkGetters: true, 
      forceRequireReturn: true, 
      forceReturnsWithAsync: true
    }],
    'jsdoc/require-returns-description': 'off',
    'jsdoc/valid-types': 'off',
  },
};

ESLint sample

class Test {
  aFunc() {}
}

CLI sample

eslint myfile.js

Environment

  • Node version: 12.16.3
  • ESLint version: 6.8.0
  • eslint-plugin-jsdoc version: 30.0.0
@gajus
Copy link
Owner

gajus commented Jul 20, 2020

馃帀 This issue has been resolved in version 30.0.1 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

@gajus gajus added the released label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants