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 doesn't recognize comment blocks with newlines afterward

See original GitHub issue

What version of ESLint are you using?

2.10.2

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

default

Please show your full configuration:

$ $(npm bin)/eslint --print-config index.js
{
  "globals": {},
  "env": {},
  "rules": {
    "require-jsdoc": "error"
  },
  "parserOptions": {}
}

What did you do? Please include the actual source code causing the issue.

/**
 * Returns "yay!"
 * @returns {String}
 */

function pleaseWork() {
  return "yay!";
}

What did you expect to happen?

No errors. jsdoc allows whitespace between the comment block and the commented node.

What actually happened? Please include the actual, raw output from ESLint.

$ $(npm bin)/eslint index.js

/Users/ruppel/Documents/Scratch/jsdoc/index.js
  6:1  error  Missing JSDoc comment  require-jsdoc

✖ 1 problem (1 error, 0 warnings)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
kaicataldocommented, Sep 27, 2017

To add to this, I also would interested in exploring alternatives to Doctrine since very few of the maintainers have much knowledge about its internals at this point and it’s hard for us to make modifications.

1reaction
kaicataldocommented, Sep 27, 2017

I’m all for discussing how we handle JSDoc comments again.

I think there are two separate issues that have been discussed here (though there may be one solution that solves them both). One is re-evaluating the logic that locates JSDoc comments, and the second is seeing if we can move away from Doctrine to another implementation.

For the first, the logic we use to locate JSDoc comments could probably be refactored and simplified, now that I look at it. Though I’m still unsure of how we would handle the cases described above.

For the latter, JSCS uses the comment-parser and jsdoctypeparser packages to parse JSDocs. We could try to do something similar, though I don’t think it’s a trivial amount of work. Both packages have quite a few monthly downloads (though one hasn’t been updated in a year).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Block and inline tags - Use JSDoc
Block tags always begin with an at sign ( @ ). Each block tag must be followed by a line break, with the...
Read more >
What is the correct way to write multi-line code in JSDoc ...
TypeScript in Visual Studio Code · press Ctrl+Alt+C twice · or select 'Comment code' from your context menu · or insert /** above...
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 >
4 JavaScript Syntax and Comments (JSDoc) - YouTube
SUBSCRIBE - hit the bell 🔔and choose all: https://goo.gl/nYLZvzIn this lesson we're going to learn all about JavaScript syntax and comments ...
Read more >
PBS 129 of X — ESLint (by Helma van der Linden)
The easiest way to install ESLint is to use npm (See pbs127 on how to ... error Extra semicolon semi 12:2 error Newline...
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