New multiline-comment-style fails for jsdoc on export default of objects
See original GitHub issueTell us about your environment
- ESLint Version: 4.9.0
- Node Version: 8.6.0
- npm Version: 5.3.0
What parser (default, Babel-ESLint, etc.) are you using? default
What did you expect to happen? I configured th new rule multiline-comment-style as an error, using “separate-lines”, in yaml, like this:
- multiline-comment-style: [2, separate-lines]
I’d expect no error on these jsdoc blocks:
import {Model} from 'backbone';
/**
* Some docs
*
* @class SomeModel
*/
export default Model.extend({
defaults: {
'some': 'fields'
}
});
I tried this, but this also fails in the same way:
import {Model} from 'backbone';
/**
* Some docs
*
* @class SomeModel
*/
const SomeModel = Model.extend({
defaults: {
'some': 'fields'
}
});
export default SomeModel;
What actually happened? Please include the actual, raw output from ESLint.
Got an error on the line containing the comment, saying “Expected multiple line comments instead of a block comment.”.
It does not give the same error for functions defined like this:
/**
* My function
*
* @function myFunc
*/
const myFunc = function() {
}
Or this:
/**
* My function
*
* @function myFunc
*/
export default function() {
}
The way of defining models as described above is a pretty standard way of defining backbone models, so it would be great if we were able to support this style as well.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
The rule is supposed to ignore all JSDoc comments when in separate-lines (or bare-block) mode, but it’s possible there is a bug in that logic.
Very sorry for wasting all you guy’s times, bug was in our own code as the jsdoc was aligned wrong:
Eslint sees this (i think correctly) as a block comment.