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:
Sebastian McKenzie 2015-02-27 23:40:59 +11:00
parent be9da7ef08
commit 932d799e28
2 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,11 @@ exports.parse = function (code) {
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
ast.tokens = tokens.map(acornToEsprima.toToken);

View File

@ -1,6 +1,6 @@
{
"name": "babel-eslint",
"version": "1.0.5",
"version": "1.0.6",
"description": "",
"main": "index.js",
"repository": {