False positive by lines-around-comment for JSDoc
See original GitHub issueTell us about your environment
- ESLint Version: 5.2.0
- Node Version: v8.9.4
- npm Version: 5.6.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
{
"env": {
"browser": true,
"es6": true,
"greasemonkey": true
},
"extends": "eslint:recommended",
"globals": {
"min": false
},
"rules": {
"lines-around-comment": [
"error", {
"afterBlockComment": true
}
]
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
/**
* Converts an array-like object to an Array.
* @param {Object} collection - The collection to be converted.
* @returns {Object[]} The resulting array.
*/
function toArray(collection) {
return Array.prototype.slice.call(collection);
}
toArray([]);
eslint scripts/**/*
What did you expect to happen?
Not throw an error.
What actually happened? Please include the actual, raw output from ESLint.
...scripts/Main/main.js
1:1 error Expected line after comment lines-around-comment
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
I think that it should make an exception for JSDoc. Meaning that /** */
is not actually a block comment, /* * */
is a block comment.
The current workaround is to use "ignorePattern": "\\*"
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
require-throws : false positive in async function #722 - GitHub
Expected behavior Do not report require-throws when a throw is added in an async function (because the function returns a rejected promise).
Read more >False Positive Missing JSDoc @return on class components
I am using eslint with the google style guide for a project, but it throws jsdoc errors for class components regardless of whether...
Read more >Command-line arguments to JSDoc
Displays JSDoc's version number, then exits. --verbose, Log detailed information to the console as JSDoc runs. Defaults to false . -X , ...
Read more >About JSDoc plugins
The jsdocCommentFound event is fired whenever a JSDoc comment is found. ... any of the following options; the default value for each option...
Read more >Use JSDoc: @type
@param {...number} num A positive or negative number */ function sum(num) { var i=0, n=arguments.length, t=0; for (; i<n; i++) { t +=...
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
This is still an issue.
Given that JSDoc support has been deprecated, JSDoc comments won’t have any special meaning to ESLint core rules going forward. If
ignorePattern
doesn’t solve the issue reported here, do you mind making a new issue proposing an enhancement that might?