pop off last token which will be an EOF, currently not used anywhere by espree and it runs into issues with some rules - fixes babel/babel-eslint#2
This commit is contained in:
parent
be9da7ef08
commit
932d799e28
@ -77,6 +77,11 @@ exports.parse = function (code) {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove EOF token, eslint doesn't use this for anything and it interferes with some rules
|
||||||
|
// see https://github.com/babel/babel-eslint/issues/2 for more info
|
||||||
|
// todo: find a more elegant way to do this
|
||||||
|
tokens.pop();
|
||||||
|
|
||||||
// convert tokens
|
// convert tokens
|
||||||
ast.tokens = tokens.map(acornToEsprima.toToken);
|
ast.tokens = tokens.map(acornToEsprima.toToken);
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "babel-eslint",
|
"name": "babel-eslint",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user