Record type range gets offset after linebreaks
smaren opened this issue · 1 comments
What version are you using?
2.1.0
What JSDoc comment were you trying to parse?
* @param {{key1: number,
* key2: number,
* key3: number}} name
What Doctrine options were you using (sloppy, unwrap, etc.)?
unwrap, range
What happened? Include output if possible.
{
"description": "",
"tags": [
{
"title": "param",
"description": null,
"range": [
3,
65
],
"type": {
"type": "RecordType",
"fields": [
{
"type": "FieldType",
"key": "key1",
"value": {
"type": "NameExpression",
"name": "number",
"range": [
18,
24
]
},
"range": [
12,
24
]
},
{
"type": "FieldType",
"key": "key2",
"value": {
"type": "NameExpression",
"name": "number",
"range": [
31,
37
]
},
"range": [
25,
37
]
},
{
"type": "FieldType",
"key": "key3",
"value": {
"type": "NameExpression",
"name": "number",
"range": [
44,
50
]
},
"range": [
38,
50
]
}
],
"range": [
11,
51
]
},
"name": "name"
}
]
}
What did you expect to happen?
Whenever the line changes, the range gets offset by by 4.
For the first line, the range is correct, the second is offset by 4 and the third by 8.
I.e, the range for key2
is 25, 37
, but the real range is 29, 41
.
If the *
is removed from the second and third line, the offset is changed to 3.
Thanks for this issue. We have decided to officially end-of-life JSDoc support in ESLint. As a result, this repository and project will no longer be maintained.
Thanks for understanding and we apologize for any inconvenience.