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

require-jsdoc failing with export default class #4667

Closed
raisen opened this Issue Dec 11, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@raisen
Copy link

raisen commented Dec 11, 2015

I have a ES6 module defined as:

/** @module storage/friends_storage */

/**
 * It handles storage of a Friends model
 */
export default class FriendsStorage {
}

require-jsdoc is failing with Missing JSDoc comment on the class definition. I have all 3 options set as true: FunctionDeclaration, MethodDefinition, ClassDeclaration

Am I missing anything?

eslint v1.10.3

@eslintbot

This comment has been minimized.

Copy link

eslintbot commented Dec 11, 2015

@raisen Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage label Dec 11, 2015

@raisen raisen changed the title require-jsdoc failed with export default class require-jsdoc failing with export default class Dec 11, 2015

@platinumazure

This comment has been minimized.

Copy link
Member

platinumazure commented Dec 11, 2015

I don't know JSDoc, but do you need a tag on the class documentation?

@raisen

This comment has been minimized.

Copy link
Author

raisen commented Dec 11, 2015

@platinumazure, according to JSDoc, you don't need for ES6.

@raisen

This comment has been minimized.

Copy link
Author

raisen commented Dec 11, 2015

@gyandeeps, ok here we go:

eslint v1.10.3

/** @module storage/friends_storage */

/**
 * It handles storage of a Friends model
 */
export default class FriendsStorage {
}

Warning I received:

6:16  warning  Missing JSDoc comment  require-jsdoc

eslintrc:

{
  "ecmaFeatures": {
    "arrowFunctions": true,
    "binaryLiterals": true,
    "blockBindings": true,
    "classes": true,
    "defaultParams": true,
    "destructuring": true,
    "forOf": true,
    "generators": true,
    "modules": true,
    "objectLiteralComputedProperties": true,
    "objectLiteralDuplicateProperties": true,
    "objectLiteralShorthandMethods": true,
    "objectLiteralShorthandProperties": true,
    "octalLiterals": true,
    "regexUFlag": true,
    "regexYFlag": true,
    "restParams": true,
    "spread": true,
    "superInFunctions": true,
    "templateStrings": true,
    "unicodeCodePointEscapes": true,
    "globalReturn": true,
    "jsx": true
  },
  "env": {
    "es6" : true,
    "browser": true,
    "commonjs": true
  },
  "extends": "eslint:recommended",
  "rules": {
    "strict": 0,
    "indent": [2, 2, {"SwitchCase": 1}],
    "no-console": 0,
    "strict": [2, "global"],
    "valid-jsdoc": 2,
    "require-jsdoc": [1, {
      "require": {
        "FunctionDeclaration": true,
        "MethodDefinition": true,
        "ClassDeclaration": true
      }
    }],
    "space-in-parens": [1, "always", { "exceptions": ["empty"] }],
    "linebreak-style": [2, "unix"],
    "max-len": [2, 100, 4],
    "max-depth": [2, 3],
    "complexity": [2, 4],
    "camelcase": [2, {"properties": "always"}],
    "no-negated-condition": 2,
    "object-curly-spacing": [2, "always"],
    "wrap-regex": 2,
    "no-unneeded-ternary": 2,
    "no-multiple-empty-lines": [2, {"max": 1, "maxEOF": 1}],
    "no-new-object": 2,
    "max-params": [2, 3],
    "no-lonely-if": 2,
    "comma-style": [2, "last"],
    "no-continue": 2
  },
  "globals": {
    "chrome": true
  }
}

I was expecting eslint to not give that warning as it looks like I have a module with valid JSDoc.

@gyandeeps gyandeeps added bug rule accepted and removed triage labels Dec 11, 2015

@gyandeeps gyandeeps closed this in fe3b286 Dec 12, 2015

ilyavolodin added a commit that referenced this issue Dec 12, 2015

Merge pull request #4684 from eslint/issue4667
Fix: Export class syntax for `require-jsdoc` rule (fixes #4667)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.