diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 6d4da4d703..355fc5d34e 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -447,6 +447,14 @@ exports.parse = function (code) { ast.tokens = acornToEsprima.toTokens(tokens); // add comments + for (var i = 0; i < comments.length; i++) { + var comment = comments[i]; + if (comment.type === "CommentBlock") { + comment.type = "Block"; + } else if (comment.type === "CommentLine") { + comment.type = "Line"; + } + } ast.comments = comments; exports.attachComments(ast, comments, tokens);