This fixes an issue that comments were added as leading comments to expressions, which are not immediately folowing the comment. This was also reported and fixed in espree, and is basically a port to babylon. eslint/espree#256 this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289
205 lines
4.5 KiB
JSON
205 lines
4.5 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"sourceType": "script",
|
|
"body": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"start": 0,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"expression": {
|
|
"type": "JSXElement",
|
|
"start": 0,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"openingElement": {
|
|
"type": "JSXOpeningElement",
|
|
"start": 0,
|
|
"end": 3,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 3
|
|
}
|
|
},
|
|
"attributes": [],
|
|
"name": {
|
|
"type": "JSXIdentifier",
|
|
"start": 1,
|
|
"end": 2,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 1
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 2
|
|
}
|
|
},
|
|
"name": "a"
|
|
},
|
|
"selfClosing": false
|
|
},
|
|
"closingElement": {
|
|
"type": "JSXClosingElement",
|
|
"start": 28,
|
|
"end": 32,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 28
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 32
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "JSXIdentifier",
|
|
"start": 30,
|
|
"end": 31,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 30
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 31
|
|
}
|
|
},
|
|
"name": "a"
|
|
}
|
|
},
|
|
"children": [
|
|
{
|
|
"type": "JSXExpressionContainer",
|
|
"start": 3,
|
|
"end": 28,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 3
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 28
|
|
}
|
|
},
|
|
"expression": {
|
|
"type": "JSXEmptyExpression",
|
|
"loc": {},
|
|
"leadingComments": [
|
|
{
|
|
"type": "CommentBlock",
|
|
"value": " this is a comment ",
|
|
"start": 4,
|
|
"end": 27,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 4
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 27
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"leadingComments": null,
|
|
"innerComments": [
|
|
{
|
|
"type": "CommentBlock",
|
|
"value": " this is a comment ",
|
|
"start": 4,
|
|
"end": 27,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 4
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 27
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
},
|
|
"comments": [
|
|
{
|
|
"type": "CommentBlock",
|
|
"value": " this is a comment ",
|
|
"start": 4,
|
|
"end": 27,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 4
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 27
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|