question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`require-jsdoc` for `constructor`

See original GitHub issue

Tell us about your environment

  • ESLint Version: 3.9.0
  • Node Version: 7.9.0
  • npm Version: Using latest Yarn

What parser (default, Babel-ESLint, etc.) are you using? Babel-ESLint

Please show your full configuration: It’s very huge, you can find it here svipben/react-boilerplate.

SUGGESTION I have suggestion to include new property in require-jsdoc rule for constructor, because right now I use JSDoc for class which explains constructor usage and I’m using comments for variables, etc. so it’s really unnecessary to rewrite everything inside constructor when everything is explained above class and in variables, etc. which are in constructor.

Right now ESLint have these properties in require-jsdoc rule:

            "FunctionDeclaration": true,
            "MethodDefinition": false,
            "ClassDeclaration": false,
            "ArrowFunctionExpression": false

My suggestion is to add for e.g. ClassConstructor or something like that, it’s up to you. This property will not check if constructor inside class have JSDoc.

I know I can simply disable this rule, ignore warnings, but I’m extensively using ESLint and it really helps me a lot when I forget about JSDoc which will be very good in future to know why, how, etc.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
platinumazurecommented, Apr 18, 2017

Seems reasonable to me. 👍 from me, let’s see what the team thinks.

0reactions
not-an-aardvarkcommented, Sep 16, 2017

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn’t get consensus from the team, so I’m closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design – we can’t realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they’re worth adding.

Since ESLint is pluggable and can load custom rules at runtime, the lack of consensus among the ESLint team doesn’t need to be a blocker for you using this in your project, if you’d find it useful. It just means that you would need to implement the rule yourself, rather than using a bundled rule that is packaged with ESLint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

require-jsdoc exemptEmptyFunctions and class constructors
A class constructor without parameters shouldn't require a JSDoc comment block. Actual behavior. Since the default value of require-jsdoc.
Read more >
require-jsdoc - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
ES 2015 Classes - Use JSDoc
JSDoc 3 makes it easy to document classes that follow the ECMAScript 2015 specification. You don't need to use tags such as @class...
Read more >
eslint-plugin-require-jsdoc-except - npm
The following example would require all named functions to be documented, except for class constructors (or other functions named constructor).
Read more >
JSDoc Reference - TypeScript: Documentation
What JSDoc does TypeScript-powered JavaScript support? ... var x = require (". ... They can also be declared as constructor functions; use @constructor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found