Fix leading comments added from previous node
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
This commit is contained in:
25
test/fixtures/jsx/basic/10/expected.json
vendored
25
test/fixtures/jsx/basic/10/expected.json
vendored
@@ -117,27 +117,8 @@
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"name": "a",
|
||||
"leadingComments": null
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " this is a comment ",
|
||||
"start": 4,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -220,4 +201,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user