require-jsdoc doesn't recognize comment blocks with newlines afterward
See original GitHub issueWhat 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:
- Created 7 years ago
- Comments:21 (18 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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).